I’m using the code below to set a background under each cell in my table view. It works fine but there’s a white space under the accessory view on the right side so the background does not cover this area. Any idea on how to fix this issue ?
(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
cell.contentView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"cell-background.png"]];
}
Thx for helping,
Stephane
You probably want to create a custom cell. Please see Apple’s documentation about contentView.
To add subviews to a cell to customize it furthur please see this. It also has a section on how to create custom cells from XIBs.