如何使按钮仅在 UITabBar 的 5 个选项卡中的 3 个中显示 UINavigationBar?
我有一个应用程序,其中有一个带有 5 个选项卡的 UITabBar。当用户摇动设备时,我希望 UINavigationBar 推送 UIImageView。当我显示 UIImageView 时,我需要隐藏选项卡和导航栏。之后,当用户点击 UIImageView 时,导航栏再次出现,用户可以转到 UIImageView 的父视图。我使导航栏显示如下:
[[self navigationController] setNavigationBarHidden:NOanimated:YES];
但在两个选项卡中,我必须使导航栏出现,以便用户可以切换到 UIImageView 的父视图,然后当父视图出现时,隐藏导航栏。我该怎么做呢?
I have an app, where there's a UITabBar with 5 tabs. When user shakes the device, I want the UINavigationBar to push an UIImageView. When I show the UIImageView, I need to hide both tab and nav bars. After that, when user taps the UIImageView, the NavBar appears again and user can go to the UIImageView's parent view. I make the Nav Bar appear like this:
[[self navigationController] setNavigationBarHidden:NO animated:YES];
But in two tabs I have to make the Nav Bar appear, so user can switch to UIImageView's parentView and then, when the parent view appears, hide the nav bar. How can I do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为你应该设置一个 UITabBarController 委托并实现这个方法:
I think you should set up a UITabBarController delegate and implement this method:
这比我想象的要容易。我只需要把
That was easier than I thought. I just have to put