I have the following code in my app which changes the cell details text items to blue.
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@, %@",
info.area, info.addressOne];
cell.detailTextLabel.textColor = [UIColor colorWithRed:0x33/255.0 green:0 blue:0x99/255.0 alpha:1.0];
Is there anyway to change the colour of the two items here independently instead of both being blue ?
Thanks,
Martin
UILabel can’t display multiple colors. You’ll need to set up a pair of labels manually and add them to the cell’s
contentView. For laying them out, use NSString’s-sizeWithFont:constrainedToSize:lineBreakMode:method to get the width of the two strings and position/size the labels accordingly.