UITabBarController的“更多"按钮下的选项卡具有2个导航栏 [英] Tabs under UITabBarController's More button have 2 navigation bars

查看:68
本文介绍了UITabBarController的“更多"按钮下的选项卡具有2个导航栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在UITabBarController上有6个视图控制器.每个控件的顶部都有一个UINavigationBar(未链接到UINavigationController),用于显示该视图控制器的标题,以及一些用于控制它的按钮.当我有5个控制器时,这很好,因为不会出现更多"按钮,但是当我添加第六个时,会出现更多按钮.在该标签下最终有两个UINavigationBars!一个是我添加的带有标题的,另一个是由TabBar创建的,并且具有返回"箭头以返回到更多页面.如何通过合并或其他方式解决此问题?

I have 6 view controllers on a UITabBarController. Each of them has a UINavigationBar at the top of them (Not linked to a UINavigationController), for showing the title of that view controller, and some buttons for controlling it. This was fine while I had 5 controllers, as no 'More' button would appear, but when I add a 6th, the more button appears. The tabs under that end up having two UINavigationBars! One is the one I added, with my title, the other is created by the TabBar and has a 'Back' arrow to go back to the more page. How can I fix this, either by merging them or otherwise?

谢谢,如果您只想问截图.

Thanks, if you want screenshots just ask.

这是屏幕截图

棕色是我制作的UINavigationBar子类,并添加到IB的视图中.另一个由Tab Bar控制器添加.

The brown one is a UINavigationBar subclass I made, and added to the view in IB. The other one was added by the Tab Bar controller.

推荐答案

是的,您需要将它们合并.由于需要更多选项卡,因此将出现更多的控制器,并且一旦导航,它将放回按钮(更多).为了解决这个问题并保持棕色navigationBar,您将需要为更多的tabs使用navigationController(仅用于其他功能,而不能用于所有功能).这会将更多(后退按钮)放在您的navigationBar上.

Yes you will need to merge them.As you need more tabs so More controller will apear and once you navigate in, it will put back button(more). In order to solve this and maintain your brown navigationBar you will need to use navigationController for those tabs in more(only for extras, not for all). This will put more(the back button) on your navigationBar.

但请记住,在more中,您还将具有edit选项,使用该选项,用户可以更改选项卡的位置.因此,在这种情况下,其他控制器可能会再次出现此问题.因此,请检查是否可以禁用tabs(重新排列)的编辑.如果不是,那么您也应该对其他controllers(在其他tabs中)

But Remember In more you will have edit option also using which user can change position of tabs. So in that case this problem may reappear for other controllers. So please check if you can disable the editing of tabs(rearrangement). If not then you should think the same for other controllers also(in other tabs)

谢谢

这篇关于UITabBarController的“更多"按钮下的选项卡具有2个导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆