I have recently migrated some code to new iOS 11 beta 5 SDK.
I now get a very confusing behaviour from UITableView. The tableview itself is not that fancy. I have custo
Here's how I managed to fix this issue while still allowing iOS 11 to set insets automatically. I am using UITableViewController
.
tableView.insetsContentViewsToSafeArea = true
) - This might not be necessary but it's what I did.tableView.contentInsetAdjustmentBehavior = .scrollableAxes
) - .always
might also work but I did not test.One other thing to try if all else fails:
Override viewSafeAreaInsetsDidChange
UIViewController
method to get the table view to force set the scroll view insets to the safe area insets. This is in conjunction with the 'Never' setting in Maggy's answer.
- (void)viewSafeAreaInsetsDidChange {
[super viewSafeAreaInsetsDidChange];
self.tableView.contentInset = self.view.safeAreaInsets;
}
Note: self.tableView
and self.view
should be the same thing for UITableViewController