Sometimes you really need to leave the table view divided in rows and have 1 section. For example, this can happen if you need to display a custom title for this table view, which remains in place while scrolling through a section.
What I would recommend doing in this case returns a higher float than the normal cell height in:
- (float)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
and then make sure the table style is Plain and the cell separator is not. You can do this in the XIB file itself or in the code:
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; self.tableView.style = UITableViewStylePlain;
Perhaps also add a cell selection style to none (otherwise it will look like you are selecting more than just the visible part of the cell).
cell.selectionStyle = UITableViewCellSelectionStyleNone;
This will give the impression of space between cells, but at the same time keeps them as rows in one section (which sometimes is what you want).
Andrei Apr 30 '13 at 16:09 2013-04-30 16:09
source share