0

There are tons of questions in the area but I can't seem to get it working.

I have a UITableView with autolayout 0 distance to superview from all edges. ViewController has under opaque bars on (my NavigationBar is opaque) AdjustScrollView inset is ON (and gets a nice contentOffset: {0, -64};)

The first cell has a weird spacing of additional 35 px:

po [self.view recursiveDescription]
<UIView: 0x7fc8a28159c0; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x7fc8a2816d80>>
   | <UITableView: 0x7fc8a1a4d000; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x7fc8a2a3ea90>; layer = <CALayer: 0x7fc8a2a23450>; contentOffset: {0, -64}; contentSize: {320, 1429}>
   |    | <UITableViewWrapperView: 0x7fc8a2a01670; frame = (0 0; 320 568); gestureRecognizers = <NSArray: 0x7fc8a2810d80>; layer = <CALayer: 0x7fc8a2a25590>; contentOffset: {0, 0}; contentSize: {320, 568}>
   |    |    | <MomentHeaderTableViewCell: 0x7fc8a2ad1630; baseClass = UITableViewCell; frame = (0 35; 320 504); autoresize = W; layer = <CALayer: 0x7fc8a2a02110>>

Where is it coming from?

Code cracker
  • 3,105
  • 6
  • 37
  • 67
Boaz
  • 4,864
  • 12
  • 50
  • 90

1 Answers1

0

What did the trick was:
self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.tableView.bounds.size.width, 0.01f)];

Found here: Why is there extra padding at the top of my UITableView with style UITableViewStyleGrouped in iOS7

Community
  • 1
  • 1
Boaz
  • 4,864
  • 12
  • 50
  • 90