James James - 2 months ago 4
Objective-C Question

UITableView - Lines Between Cells

I have a

that has cells of which, for this example, let's say only the top two are filled. For the rest of the cells going down the list there are still separator lines.

Is there a way to turn the lines off where there are empty cells but keep them on to separate cells that contain information?


No there is no built in support for this.

You could turn off the cells on the table view with:

self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

And then draw the separator lines in your own UITableViewCell subclasses that you use for the rows.