I want a space between two cell in table view,
I want cell like this,
<
I have used a simple and quick approach for this (using storyboard)
When the table view will be loaded, it will feel like there are spaces between cells.
1) first create 2 sections in table view. 2) create an empty cell. 3) create the cell with data you want to display. 4) use the method
(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section==0) {
if (indexPath.row % 2 != 1) { return 15.0; } else { return 100; } } else
if (indexPath.row % 2 != 1) {
return 100.0;
} else {
return 15.0;
}
}
It will add space between the cells. It worked for me.