标签栏控制器并非在所有UIViewControllers中 [英] Tab Bar Controller is not in all UIViewControllers
问题描述
我刚刚在项目中创建了一个标签栏控制器,共有4个标签。
I just created a tab bar controller in my project with 4 tabs in total.
在4个UIViewController之间正常工作。
It works fine between the 4 UIViewControllers.
但是,当我导航到另一个不是四个选项卡之一的UIViewController时,选项卡栏消失了。
However when I navigate to another UIViewController which is not one of the 4 tabs, the tab bar disappears.
我希望它在每个页面中都能看到。我该怎么做?
I want it to be seen in every page. How can I do this?
推荐答案
好。
这是通过在每个选项卡上使用导航控制器来完成的。
The way this is done is by using navigation controllers on each tab.
因此,您有了选项卡栏控制器。然后,每个选项卡首先都有一个导航控制器,导航控制器的根视图控制器就是您要在该选项卡中找到的页面。
So, you have your tab bar controller. Then each tab has a navigation controller first and the root view controller of the navigation controller is the page you want in that tab.
现在,当您使用推送搜索时,导航控制器将推送新页面,而标签栏控制器将保持在原位。
Now when you use a push segue the navigation controller pushes the new page and the tab bar controller remains in place.
这篇关于标签栏控制器并非在所有UIViewControllers中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!