开发者

iphone uitableviewcell - mulitiple colors in the same cell textLabel?

开发者 https://www.devze.com 2023-01-16 09:53 出处:网络
cell.textLabel.text = [NSString stringWithFormat:@\"your name: %@\", you开发者_Python百科rName];
cell.textLabel.text = [NSString stringWithFormat:@"your name: %@", you开发者_Python百科rName];

I need yourName to appear in red (while "your name" stays the default black color). Possible? How?


You will need to create 2 UILabels, one containing the 'your name' and the second UILabel has the variable. The first has a textcolour of black and the second is red

Have a look here for creating custom UITableViewCells

0

精彩评论

暂无评论...
验证码 换一张
取 消