3

I need to make a grouped table view with custom cells. Each cell must have a background image, so that image of one cell will touch the image of the second cell and so on. I've tried to set the separatorStyle to None, but I still get the transparent separator between cells. Help me, please, remove this space between cells.

Have a good day, Thanks!

lonlywolf
  • 505
  • 5
  • 16

1 Answers1

0

I found that when I set the background image, the separator went away automatically. The problem is that I want it to show up.

Here's what I did:

Create a custom UITableViewCell class. In the respective init method do:

    // Create a background image view.  
    self.backgroundView = [[UIImageView alloc] init];

Then in your controller that manages the UITableView:

- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // After all of the cell dequeue/allocation...

    UIImageView *backgroundView = (UIImageView *)cell.backgroundView;
    backgroundView.image = [UIImage imageNamed:@"your_image"];
}
Howard Spear
  • 551
  • 1
  • 5
  • 14