ios16 navigation bar appear inside safe area

Hi guys

Has anybody hit any issues with the Navigation bar and tab bars being in the safe area. With ios16 the navigation bar appears onto of the status bar (in the safe area), the tab bar is also in the safe area.

However, putting the device into landscape and then portrait brings it back closer (although the buttons no longer have an indentation). In the screenshot on the left is how the app is first displayed and on the right is how it changes after rotation.

This is working fine in ios15

I know Apple having been making changes in this area, but the app is set to ios15 as the minimum deployment and I'm not using any of the new features, so I wasn't expecting this issue.

Changing the navigation bar frame seems to have no effect

Anybody any clues?

Answered by rowets2 in 720077022

Fixed it!

So our app was creating a RootViewController which was extending UIViewController

Inside the RootViewController, we create a UITabBacontroller and add it's view as a sub view of the RootViewController

Slightly odd I know, might have picked this up from an online post.

This has been working fine with no issues for over 10 years

The fix was to instead make the RootViewController extend UITabController (and therefore no longer needing to add to any sub views)

The problem then went away

Hope this help somebody else

It isn't clear why this would be happening to you – how do you have your view controller hierarchy setup? Is it just UINavigationControllers in UITabBarControllers or something more complex? If nothing else, it can often help to try to create a minimal reproduction case to narrow down what configuration is causing the issue, and then it makes it easy to file a feedback report.

The app is as you say, a simple tab bar controller with a number of tabs and on each tab, the screen allows the user to go to child screens using pushViewController, although in the screenshot I've not even got that far.

Thanks for replying, as you say it looks like the next step is a test app and then submitting a fault to Apple

Odd though, this app has been fine since ios5!

I am having this same issue on iOS 16 beta 2, so you are not alone.

Accepted Answer

Fixed it!

So our app was creating a RootViewController which was extending UIViewController

Inside the RootViewController, we create a UITabBacontroller and add it's view as a sub view of the RootViewController

Slightly odd I know, might have picked this up from an online post.

This has been working fine with no issues for over 10 years

The fix was to instead make the RootViewController extend UITabController (and therefore no longer needing to add to any sub views)

The problem then went away

Hope this help somebody else

I'm having this same issue on iOS 16 the official release. Here's a reference to a ticket I made on a 3rd Party Library about it: https://github.com/LeoNatan/LNPopupUI/issues/18

ios16 navigation bar appear inside safe area
 
 
Q