UITabBarController和UINavigationController内部的“编辑"按钮 [英] Edit button inside UITabBarController and UINavigationController

查看:47
本文介绍了UITabBarController和UINavigationController内部的“编辑"按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是将我的UINavigationController嵌入到UITabBarController中.我再也看不到我的视图标题或编辑按钮.请参阅下面的情节提要.如何使编辑按钮再次可见?

I just embedded my UINavigationController into a UITabBarController. I can no longer see my view title or edit button. Please see storyboard below. How do I make the edit button visible again?

我的故事板:

推荐答案

而不是以下组织(您当前正在使用):

Rather than the following organization (which you're currently using):

NavController -> TabBarController -> ViewControllerA
                                  \
                                   -> ViewControllerB

您必须执行以下操作:

TabBarController -> NavControllerA -> ViewControllerA
                 \
                  -> NavControllerB -> ViewControllerB

UITabBarController s应该始终是根视图.每个子视图控制器都需要自己的导航控制器,以实现所需的导航栏+选项卡栏效果.这是一个结构外观的示例:

UITabBarControllers should always be the root view. Each child view controller needs its own navigation controller to achieve the navigation bar + tab bar effect you desire. Here is an example of what the structure should look like:

完成上述操作后,要将导航项/标题添加到每个视图控制器,请确保将导航项拖到每个视图控制器上.您可以在实用工具"视图底部的对象库"中找到导航项:

As for adding navigation items / titles to each view controller once you've done the above, make sure to drag Navigation Items onto each view controller. You can find the Navigation Item in the Object Library at the bottom of the Utilities view:

这篇关于UITabBarController和UINavigationController内部的“编辑"按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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