【发布时间】:2014-03-04 02:28:27
【问题描述】:
我为我的问题制作了一个示例项目,以便您更好地理解它。你可以在这里得到它:
https://github.com/nwalter08/iOS-7-Container-View-Controller-Probs
我的问题是我有一个UITabBarController,它拥有一个Container UIViewController,它拥有一个UINavigationController,它拥有一个UIViewController。我知道很多:)
问题是当我在 iOS 7 上运行应用程序时,UIViewController 并没有填满整个UINavigationController 的空间。当我在 iOS 6 中运行时,这不是问题。
一些特别说明是我将tabBar 和navigationBar 上的translucent 属性设置为NO。我也没有使用 IB 或故事板。
我已经对视图控制器进行了颜色编码,以便您可以看到UIViewController 太短并且黄色的UINavigationController 背景正在显示。
iOS 6
iOS 7
更新—— 因此,rdelmar 的答案适用于其中没有内容的 UIView,但我发现我的代码内容被拉伸并且不适合。我很确定这是一个 iOS 错误,我向 Apple 提交了 Radar。为了解决我的问题,我使用了 UITabBarController 替换 https://github.com/jinthagerman/JBTabBarController
【问题讨论】:
-
您可能需要调整您的 iOS 6/7 增量。 stackoverflow.com/questions/17794037/…
-
你没有 IB,我会在问题中提到这一点。
标签: ios objective-c uiviewcontroller