我以编程方式创建一个 tabBarViewController,然后将其选项卡式 View Controller 之一设置为 NavigationController。在我的另外两个由选项卡栏 Controller 呈现的 View 中,它们是 UIViewController 的子类, View 的大小适合 TabBar。但在 NavigationController 呈现的 View 中, View 的大小并未考虑到 tabBarController。 我是否可以更改 Nav 或 Tab Controller 的属性,以便 NavController 显示的 View 自动说明 TabBar 的存在? 我意识到我可以通过编程方式设置导航 Controller 呈现的 View 的底部,但这会非常笨拙。
谢谢。
最佳答案
在 IB 中,如果您选择您的 View Controller ,并查看属性检查器中的“ View Controller ”部分,您将看到 View 的默认设置为“Under Top Bars”和“Under Bottom Bars” ”。如果您不希望出现这种行为,请取消选择其中一个或两个框。与此等效的代码是 UIViewController 的 edgesForExtendedLayout 属性。
关于ios - 由嵌入在 UITabBarController 中的 UINavigationController 呈现的 View 不会调整 View 大小以考虑 View 底部的 tabBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27108322/