Set background color of UITableViewCell

Viewed 23216

I have looked around to find a solution for setting the background color of the accessoryView to the same background color as the cell´s contentView.

    cell.contentView.backgroundColor = [UIColor colorWithRed:178/255.f green:14/255.f blue:12/255.f alpha:0.05];
    cell.accessoryView.backgroundColor =[UIColor colorWithRed:178/255.f green:14/255.f blue:12/255.f alpha:0.05];

There is a solution that works but only let me use one color for all cells.

cell.contentView.superView.backgroundColor = [UIColor redColor];

Is the only solution to not use the accessoryView and use an image instead?

Thanks!

6 Answers
Related