Home > database >  Is all this *really* the 'safe' area and how far down UINavigationController puts UINaviga
Is all this *really* the 'safe' area and how far down UINavigationController puts UINaviga

Time:06-21

*** UPDATE: THIS IS WHAT IT LOOKS LIKE WHEN YOU HAVE A NAVIGATION CONTROLLER IN A NAVIGATION CONTROLLER ***

I have a tab bar as a navigation controller. My views present like this (the navigation controller decides its placement).

Does that look right? That seems pretty far down on the screen (in the simulator), notch notwithstanding.

Without doing a custom controller for the Navigation Bar, is there some reasonable way to reclaim some of that space above the navigation bar by sliding it up?

enter image description here

CodePudding user response:

By default, top safeArea contains status bar offset and navigationBar offset.

You can have only the status bar offset should you hide the navigation bar.

So, the code may help.

navigationController?.isNavigationBarHidden = true

CodePudding user response:

At the beginning of the project I was a big confused about the navigation controller stack and wrapped a tab bar controller, and later made one of the tab bar controller children controllers a navigation controller as well, so apparently iOS was stacking the navigation controllers and making the first one invisible. Removing the 2nd navigation controller let everything move up.

  • Related