I’m writing a small application to teach myself new design and information retrieval tricks. I’m using the following line to set the background of my UITableViewCell subclass:
cell.contentView.backgroundColor = [UIColor blackColor];
… but it doesn’t seem to want to get behind that accessory view:

How do I get the backgroundColor to actually span the entire background of the UITableViewCell?
The accessory view is not added to the cell’s contentView. As you can see, the content view is resized by shrinking from the right so the accessory can fit in. This also happens when the delete button is shown.
You need to set the
backgroundColorof the whole cell – furthermore, this has to be done in thetableView:willDisplayCell:forRowAtIndexPath:
delegate method.