UITabBarController 的“更多”按钮下的选项卡有 2 个导航栏
我在 UITabBarController 上有 6 个视图控制器。它们每个的顶部都有一个 UINavigationBar (未链接到 UINavigationController),用于显示该视图控制器的标题,以及一些用于控制它的按钮。当我有 5 个控制器时这很好,因为不会出现“更多”按钮,但当我添加第 6 个控制器时,会出现更多按钮。下面的选项卡最终有两个 UINavigationBar!一个是我添加的,带有我的标题,另一个是由 TabBar 创建的,并且有一个“后退”箭头可返回到更多页面。我该如何解决这个问题,通过合并它们还是其他方式?
谢谢,如果您想要屏幕截图,请询问。
这是一个屏幕截图
棕色的是我制作的 UINavigationBar 子类,并添加到在IB中查看。另一种是由选项卡栏控制器添加的。
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.
Here's a screenshot
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,您需要合并它们。由于您需要更多选项卡,因此会出现更多控制器,一旦您导航,它将放置后退按钮(更多)。为了解决这个问题并维护你的棕色
navigationBar
,你将需要使用navigationController
来处理更多的选项卡
(仅适用于额外功能,不适用于所有内容) )。这将在您的navigationBar
上放置更多内容(后退按钮)。但请记住,在
more
中,您还将拥有edit
选项,用户可以使用该选项更改选项卡的位置。因此,在这种情况下,其他控制器可能会再次出现此问题。因此,请检查是否可以禁用选项卡
的编辑(重新排列)。如果不是,那么您应该对其他控制器也有同样的想法(在其他选项卡中)谢谢,
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 usenavigationController
for thosetabs
in more(only for extras, not for all). This will put more(the back button) on yournavigationBar
.But Remember In
more
you will haveedit
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 oftabs
(rearrangement). If not then you should think the same for othercontrollers
also(in othertabs
)Thanks,
好的,遵循了您的所有提示,但没有运气,直到:我测试了这个 https://stackoverflow.com/a/3397506/468868< /a>
基本上,你是对的@Ravin,我们必须将这些项目包装在 NavigationControllers 中,但之后,你必须指定:
现在,我只需要弄清楚如何从中删除 navigationController “更多”视图
Ok, Followed all of your tips but no luck, until: I tested this https://stackoverflow.com/a/3397506/468868
Basically, you are right @Ravin, we must wrap the items in NavigationControllers, but after that, you must specify that:
Now, I just need to figure it out how to remove the navigationController from the "More" view