将 UIViewController 显示为模态时隐藏 UITabBar
我有一个 UIViewController,它有一个模式窗口,我想在整个界面上显示它,包括 UITabBar。
我的应用程序层次结构是这样的:
UITabBarController (A) ->
UIViewController (B) ->
UINavigationController (C) ->
UIViewController (D) ->
UIViewController (my modal view)
当我在 D 上调用 presentModalViewController
时,会显示模式视图,但位于 UITabBar 下方,或者应该说,UITabBar 仍然显示。
我尝试在模式视图控制器上将 hidesBottomBarWhenPushed
属性设置为 YES
,但无济于事。
关于为什么这对我不起作用有什么想法吗?
I've got a UIViewController that has a modal window which I'd like to present over the entire interface, including the UITabBar.
My application hierarchy is this:
UITabBarController (A) ->
UIViewController (B) ->
UINavigationController (C) ->
UIViewController (D) ->
UIViewController (my modal view)
When I call presentModalViewController
on D, the modal view is presented but underneath the UITabBar, or should I say, the UITabBar is still shown.
I've tried setting the hidesBottomBarWhenPushed
property to YES
on the modal view controller, but to no avail.
Any ideas on why this isn't working for me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
模态
ViewController
需要是TabBarController
的直接子级才能执行您想要的操作。在 ViewController "D" 中,而不是 :
do:
如何维护对
TabBarController
的引用取决于您。The modal
ViewController
needs to be a direct child of theTabBarController
in order to do what you want.in ViewController "D", instead of :
do:
how you maintain a reference to the
TabBarController
is up to you.