I would like to make a grouped UITableView where the cells are not 100% width, this is because I want to show the background, and each cell will have rounded corners.
Sort of like this;
However, I'm not sure how to do this using Storyboard; or is it only something you can do in code?
Ideally, I'd like the whole area scrollable; but make the cells appear less than 100% width
Not sure if this is the best solution; the one I have so far is...
In storyboard
- (void)setFrame:(CGRect)frame { frame.origin.x += kInset; frame.size.width -= 2 * kInset; [super setFrame:frame]; } -(void) drawRect:(CGRect)rect { [self.layer setCornerRadius:kCornerRadius]; [self.layer setMasksToBounds:YES]; }
The constants are just any number for now, say 10
Next I ensure my UITableViewCell is pointing to this subclass.
Now my cells appear with a margin and the uitableview itself is 100% width.
I will have to keep playing around with it; maybe there is a better solution