是否可以隐藏 UISplitViewController 上的导航栏?
我有一个非常简单的应用程序,我想在其中使用 UISplitViewController。它太简单了,我不希望导航栏在纵向中可见,因为左窗格中没有导航。 (我确实想以纵向方式显示它,以便弹出窗口出现。但是,我似乎无法隐藏它。顶部元素甚至是导航栏吗?
我已经尝试过这两种方法:
[[splitViewController navigationController] setNavigationBarHidden:YES animated:NO];
for(UIViewController* vc in [splitViewController viewControllers]) {
[[vc navigationController] setNavigationBarHidden:YES animated:NO];
}
但都不起作用。
I have a very simple app that I want to use a UISplitViewController in. It's so simple that I don't want the NavigationBar visible in portrait because there is no navigation in the left pane. (I do want to show it in portrait for the Popover to appear from. However, I don't seem able to hide it. Is the top element even a Nav Bar?
I've tried both of these:
[[splitViewController navigationController] setNavigationBarHidden:YES animated:NO];
for(UIViewController* vc in [splitViewController viewControllers]) {
[[vc navigationController] setNavigationBarHidden:YES animated:NO];
}
But neither works.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你试试这个:
源代码:
https://github.com/mattgemmell/MGSplitViewController/
它有助于隐藏 SplitViewController 上的导航栏
you try this:
source code:
https://github.com/mattgemmell/MGSplitViewController/
it helpful for hide the nav bar on a SplitViewController