I am trying to add background color to my cell but was not able to color the portion with the disclosure indicator (see screenshot below)
What can I do to color the entire cell? My implementation as follows.
cell.contentView.backgroundColor = [UIColor colorWithHexString:@"#FFFFCC"];
//Clear colors for labels
cell.textLabel.backgroundColor = [UIColor clearColor];
cell.detailTextLabel.backgroundColor = [UIColor clearColor];
UIImageView with a chevron image on the right-hand side. Preferably in the storyboard, but it can easily be managed in code by attaching it to the content view.
UITableViewCell subclasses UIView; you can set its background color just as you can any other view’s. Cells in a “grouped”-style table view require some more work there, but it doesn’t look like you’re using that, so:
cell.backgroundColor = [UIColor colorWithHexString:@"#FFFFCC"];
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