1

I would like to eliminate the space in these two places programatically?

enter image description here

I have tried this without much luck:

- (CGFloat)tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section {
    return 35.50;
}

- (CGFloat)tableView:(UITableView*)tableView heightForFooterInSection:(NSInteger)section {
    return CGFLOAT_MIN;
}

UPDATE: I have seen this solution and it doesn't help me.

After applying the suggested solution of

self.yourTableView.sectionHeaderHeight = 0
self.yourTableView.sectionFooterHeight = 0

I get this, but thats not correct. The whole section title is gone.

enter image description here

Community
  • 1
  • 1
Houman
  • 64,245
  • 87
  • 278
  • 460

3 Answers3

0

Why you return 35.5 in the heightForHeaderInSection? It is your header height?

Try this and remove heightForHeaderInSection and heightForHeaderInSection functions from your UITableViewDelegate:

self.yourTableView.sectionHeaderHeight = 0
self.yourTableView.sectionFooterHeight = 0

Or this

-

 (CGFloat)tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section {
    return 0;
}

- (CGFloat)tableView:(UITableView*)tableView heightForFooterInSection:(NSInteger)section {
    return 0;
}
Vitalii Gozhenko
  • 9,220
  • 2
  • 48
  • 66
  • Thanks, please see updated question. zero deletes the entire title as well. – Houman Aug 30 '15 at 08:55
  • I checked updated answer, and I think the problem is in your `UITableViewCell` It have some vertical spacing constraints with extra padding. Or maybe that constraints related to margins, not borders of cell. Please re-check your cell autolayout constraints – Vitalii Gozhenko Aug 30 '15 at 09:34
0

I give you clear reference from below link

Click Here

Credit goes to Tomen

Community
  • 1
  • 1
user3182143
  • 9,459
  • 3
  • 32
  • 39
0

It looks like your cell have margin Open Debug>Debug view hierarchy and see where is your margin

Ermal Kaleci
  • 126
  • 6