My iPhone app is currently displaying a grouped table with 2 sections. I tried to change the radius of the rounded corners on the first and last cells of each section (or on the same cell in the case of sections with just one row) using:
cell.layer.cornerRadius = 4;
or acting on the whole tableview:
self.tableView.layer.cornerRadius = 4;
but no luck...Of course I've imported QuartzCore before performing this operation. It looks like it's possible to customise the corners only when the table is displayed with plain style.
The ideal solution would be to customise top corners in the first one and bottom corners in the last.
Any suggestions?
The simplest way is:
Make a custom cells in a xib file, set their unique identifiers like: @"beginCell", @"middleCell", @"endCell"
. You can make it according to this tutorial: http://www.bdunagan.com/2009/06/28/custom-uitableviewcell-from-a-xib-in-interface-builder/
In method
- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
you have to find ejther you are in the middle or on begin/end of the section and use the cell with proper identifier.