Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableView - Lines Between Cells

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?

like image 390
Baub Avatar asked Aug 29 '11 14:08

Baub


People also ask

How do you add a space between UITableView cells?

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.

What is a UITableView?

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.


1 Answers

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.

like image 111
PeyloW Avatar answered Oct 27 '22 18:10

PeyloW