Currently I am setting the background Image (UIImageView) in each UITableViewCell in the cellforrowatindex path.
This is how I set it:
if (indexPath.row%2) {
cell.backgroundImage.image = [UIImage imageNamed:@"Image1.png"];
}
else {
cell.backgroundImage.image = [UIImage imageNamed:@"Image2.png"];
}
The problem is, when I edit it by doing setEditing: there is a white space on the left side where the red circle button is which I do not want. I want it to continue being either Image1 or Image 2 in that area that comes in from the left when starting to edit.
How can I modify my code to do that?
Thanks!
If your tableview is grouped you can use
if not the other option I know of is to take your background for a cells 1 & 2 and create one resizable image that tiles with
and use that as your tableview background. capInsets would of course be all zero.
If your cells are standard height make a new image in photoshop that is a combination of your cell1 & cell2 background that you want to alternate down the table, 320×88 and call it ‘cell_1_2’. Then use that as your tableview background, and it will be tiled/repeat the length of your tableview. The only problem would be if the number of cells in the table didn’t take up the height of the screen, the background image would still tile to the bottom of the view. So it may not be the best solution.