I have added some data in UITableView, and I want to change the color of the text displayed in the cells.
Is there a delegate method for doi开发者_运维问答ng this, or any other way?
NO need for Labels
You just need to code :
cell.textLabel.textColor = [UIColor redColor];
or if you want to change the detailTextLabel :
cell.detailTextLabel.textColor = [UIColor blueColor];
good luck
You can add labels in the cell and set the color for these labels according to you .And also you can add more than one label and customize the cell.
simply use this line
cellLabel.textColor=[UIColor redColor]; //according to you.
The code according to hex number of color code
Use this code
If color code is: #4B4B4B so Red:75 Green:75 Blue:75
cell.textLabel.textColor =
[UIColor colorWithRed:75.0/255.0 green:75.0/255.0 blue:75.0/255.0 alpha:1];
精彩评论