iOS 11及更高版本iPhone X:嵌入UITabBarController时,UINavigationBar的工具栏间距不正确 [英] iOS 11 & iPhone X: UINavigationBar's toolbar spacing incorrect when embedded in UITabBarController

查看:118
本文介绍了iOS 11及更高版本iPhone X:嵌入UITabBarController时,UINavigationBar的工具栏间距不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iPhone X模拟器上测试最新的iOS 11时遇到麻烦的问题。

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

我有一个 UITabBarController ,每个选项卡中都有一个 UINavigationController ,每个 UINavigationBar 都还定义了一个底部toolBar( setToolbarHidden:),默认情况下,它们显示在底部的tabBar上方。

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.

到目前为止,它一直运行良好并且似乎在即将面世的iPhone 8和8 Plus机型中也能正常工作,但在iPhone X上,toolBar和tabBar之间存在差距。我的猜测是toolBar不会意识到它会显示在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.

我想唯一的解决方法是使用自定义工具栏并自己显示/设置动画,而不是使用默认值 UINavigationBar ,但我想听听其他选项:)

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 :)


  • 这是在iPhone 8上的样子。

  • 这是iPhone X上的问题。

推荐答案

我将其归档为radr:// problem / 34421298,已将其作为radr:// problem / 34462371的副本关闭。但是,在最新的带有iOS 11.2的Xcode 9.2(9C32c)测试版中,此问题似乎已解决。这是我的应用程序在每个设备的模拟器中运行且之间没有更改的示例。

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.

这并不是解决您问题的 ,除了一些耐心可以解决它而无需诉诸UI技巧。我认为iOS 11.2将在今年年底之前发布,因为它需要支持HomePod。

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.

这篇关于iOS 11及更高版本iPhone X:嵌入UITabBarController时,UINavigationBar的工具栏间距不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆