Search code examples
iosuitabbariphone-xbottombarsafearealayoutguide

How to get UITabBar to extend to bottom on iPhone X?


1

I have tried putting a view down there to see if there is a way to have it be visible in that little area outside the safe zone, but actually it is clipped away.

Can anyone provide assistance on this? The only tutorial I have seen mention this issue is this one: https://novemberfive.co/blog/apple-september-event-iphonex-apps/ however my UITabBarController does not contain a similar view hierarchy (despite enabling 'Use Safe Area Layout Guides').

EDIT: Without the purple view:

https://i.sstatic.net/b17e2.png


Solution

  • So I got this fixed. So it turns out awhile ago I used a containerVC to ensure that the backgroundImageView for my app looked consistent regardless of the UISplitControllerVC's children (which all have transparent backgrounds). Most of the constraints in XCode 9 are reconfigured for your project to align with the safe area, which, while this may act as a good starting point - it can make your app look totally broken. To fix this, simply re-adjust these constraints to align with the superview, as they originally did. Now everything works as expected and its all fixed up lookin'. No need for an additional UIView, the UITabBarController filled the space on its own.

    Portrait: https://i.sstatic.net/0LWlf.png

    Landscape: https://i.sstatic.net/4Dhrt.jpg Not totally liking how small that TabBarIcon is. I wonder if that can be changed.