0

Does anyone know why a UITableView inside a UIViewController always has a gap above the UITableViewCell. I'm aware that this is expected for Grouped cells, but this is a Plain cell.

How can I remove the gap?

enter image description here

enter image description here

yhl
  • 669
  • 1
  • 6
  • 18

2 Answers2

0

[[self UITableView] setContentInset:UIEdgeInsetsMake(-65, 0, 0, 0)];

That did the trick for me.

yhl
  • 669
  • 1
  • 6
  • 18
0

One of the proposed answers to the quesion UITableView is getting a gap on top solved this for me, although it's not the approved answer.

Just add this code in ViewDidLoad

self.automaticallyAdjustsScrollViewInsets = NO;

Alternatively, you can set this property on the ViewController in the storyboard.

Community
  • 1
  • 1
Alistair
  • 1,104
  • 9
  • 15