4

From my storyboard, I have embedded my UITableView into my UINavigationController. This works fine for non-iPhone X devices.

The top parts (the UINavigation bar & UITableView) works fine.

In the iPhone X simulator, the bottom of the scrolling UITableView is cutoff by the new iPhoneX "home area". Meaning the UITableView is escaping out of the safe area & getting clipped.

Since I'm not setting my UITableView's height or constraints anywhere (it is embedded) and I don't think you can control the frame for the UINavigation View, how do I make sure my scrolling UITableView does not get clipped by the iPhoneX "home area"?

I've tried adding constrains to my UITableView, but Xcode will break the constraints as they are conflicting. I've also tried using UITableView's insetsContentViewsToSafeArea from both Interface Builder and programmatically. These don't appear to work.

Thanks!

xta
  • 729
  • 2
  • 8
  • 29
  • Can you share a screenshot of the storyboard (specifically `Document outline`) to show the view hierarchy? – Adeel Miraj Oct 28 '17 at 06:18
  • @Adeel Is this what you mean by document outline? https://imgur.com/a/T6rr9 I used imgur since I'm not sure where else to upload the document outline – xta Oct 29 '17 at 07:05
  • Check [Setting tableView constraints in iPhone -X](https://stackoverflow.com/a/46924478/7576100) – Jack Oct 30 '17 at 03:56
  • Did you try to change contentInsetAdjustmentBehavior property, which is .automatic by default. You can change to .never. tableView.contentInsetAdjustmentBehavior = .never – missionMan Nov 07 '17 at 09:31
  • Probably unrelated. I was struggling with same problem after embedding a UITableViewController. I finally realised that I had some code which changed its size programatically after I had embedded it. – user2002649 Nov 17 '17 at 02:20
  • My update is that this seems like intended behavior on the iPhone X. Even though it looks bad to me, Apple appears to consider it acceptable. – xta Dec 16 '17 at 05:42

0 Answers0