Set cell text color

Apparently this is deprecated:

cell.textColor = [UIColor whiteColor]; 

Does anyone know the best way to change the color of cell text?


Edit after comment:

Now I use this:

 cell.textLabel.textColor = [UIColor whiteColor]; 

but the color still does not change, see IB parameters:

alt text

+7
objective-c iphone
source share
2 answers

cell.textLabel.textColor = [UIColor whiteColor];

+17
source share

As Apple says on the UITableViewCell page http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableViewCell_Class/Reference/Reference.html

The color of the title text. (Deprecated in iOS 3.0. Instead, set the text color attribute of the UILabel objects assigned to the textLabel and detailTextLabel properties.)

You should use textLabel instead of textColor; -)

Edit: you must add your OWN textLabel. You must forget cell.text

+2
source share

All Articles