Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 11 & iPhone X: UINavigationBar's toolbar spacing incorrect when embedded in UITabBarController

I am experiencing an annoying problem testing the newest iOS 11 on the iPhone X simulator.

I have an UITabBarController and inside each tab there is a UINavigationController, each UINavigationBar has defined also a bottom toolBar (setToolbarHidden:), and by default they show up at the bottom, just over the tabBar.

It has been working fine so far and seems to work fine also in the upcomming iPhone 8 and 8 Plus models, but on the iPhone X there is a gap between the toolBar and the tabBar. My guess is that the toolBar doesn't realize that is displayed inside a tabBar and then leaves the accommodating space at the bottom.

I guess the only way to fix it would be using a custom toolbar and display/animate it myself instead of using the defaults UINavigationBar, but I would like to hear other options :)

  • This is how it looks on iPhone 8.
  • And here is the problem on iPhone X.

enter image description here enter image description here

like image 787
apascual Avatar asked Sep 13 '17 19:09

apascual


People also ask

Is iOS 11 still supported?

17, 2018. Does Apple still support iOS 11? No, Apple ended support for iOS 11 in 2018 when it introduced iOS 12.

How do I upgrade to iOS 11?

Go to Settings > General > Software Update. Tap Automatic Updates, then turn on Download iOS Updates. Turn on Install iOS Updates. Your device will automatically update to the latest version of iOS or iPadOS.

Is iOS 11 free to download?

iOS 11 is a free update to Apple's long-running iOS operating system for phones and tablets.


1 Answers

I filed this as radr://problem/34421298, which was closed as a duplicate of radr://problem/34462371. However, in the latest beta of Xcode 9.2 (9C32c) with iOS 11.2, this seems to be fixed. Here's an example of my app running in the simulator of each device, with no changes in between.

Navbar toolbar under iOS 11.1 and 11.2

This isn't really a solution to your problem, other than that some patience may solve it without needing to resort to UI trickery. My assumption is that iOS 11.2 will be out before the end of the year, since it's needed to support HomePod.

like image 66
greg Avatar answered Sep 18 '22 20:09

greg