Setting the contentInset on a UITableView doesn't seem to work on iOS 7:
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0);
// Works on iOS 6, nothing happens on iOS 7
I've tried setting self.automaticallyAdjustsScrollViewInsets
to NO
in viewDidLoad, still nothing.
What am I doing wrong? Is there a new way to do this or a workaround?
Moving this code into the view controller's -viewDidLayoutSubviews
method fixed this for me.
-(void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0);
}
Thanks Apple for your non-existent documentation on this!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With