I want to have square corners for my grouped tableview cells instead of the default rounded corners, and I don\'t just want to use an image to give that effect. Is it possib
The accepted answers works well, but unfortunately removes the separator lines between cells. If you have a 3x3 pixel TableCellBackground.png, with the top two rows of pixels white and the lowest third row grey (to match the separator color), you can do:
// 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;