I have a UITableView
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?
The way I achieve adding spacing between cells is to make numberOfSections = "Your array count" and make each section contains only one row. And then define headerView and its height. This works great.
UITableView manages the basic appearance of the table, but your app provides the cells ( UITableViewCell objects) that display the actual content. The standard cell configurations display a simple combination of text and images, but you can define custom cells that display any content you want.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With