Принятые ответы работают хорошо, но, к сожалению, удаляют разделительные линии между ячейками.Если у вас есть TableCellBackground.png размером 3x3 пикселя, с двумя верхними рядами пикселей белого цвета и самым низким третьим рядом серого цвета (в соответствии с цветом разделителя), вы можете сделать:
// To square the corners, we replace the background view of the top and bottom cells.
// In addition, the top cell needs a separator, which we get from TableCellBackground.png.
UIImage *stretchableImage = [UIImage imageNamed:@"TableCellBackground.png"];
UIImage *cellImage = [stretchableImage resizableImageWithCapInsets:UIEdgeInsetsMake(1, 1, 1, 1)];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:cell.bounds];
imageView.image = cellImage;
cell.backgroundView = imageView;