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 doing this, or any other way?
Basic Swift Code for iOS Apps For changing the background color of the table view cell, you should change the contentView. backgroundColor property of the cell. Now run the project to see the effect.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With