0

I encouter a problem as described here: tableView separator layout issue in IOS 7

I couldn't find any answer to solve this problem yet. So I hava to find another way to solve this. I decide to only keep the separator lines from the cells that has data, but remove all the separator lines from the cells which are empty (circle in red line, in print screen below). So how can I do that?

enter image description here

Community
  • 1
  • 1
Sam YC
  • 10,725
  • 19
  • 102
  • 158

3 Answers3

4

try this , just 1 line of code is required

 [tableview setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]];
Shaik Riyaz
  • 11,204
  • 7
  • 53
  • 70
1

You can do like this, by setting the frame

if (self.tableView.contentSize.height < self.tableView.frame.size.height) {
    self.tableView.frame = CGRectMake(self.tableView.frame.origin.x, self.tableView.frame.origin.y, self.tableView.frame.size.width, self.tableView.contentSize.height);
}
Raheel Sadiq
  • 9,847
  • 6
  • 42
  • 54
0

Easiest way imo is setting a header- and footerview for the tableView. If you don't want content for them, just set the content to a CGRectZero. Should work for your case too.

Totumus Maximus
  • 7,543
  • 6
  • 45
  • 69