简体   繁体   English

在所有控制器中带有标签栏和导航栏的应用

[英]Application with tab bar and navigation bar in all controllers

I have a problem with adding tab bar to all the controllers in the screen, it's only shown in the controllers that is directly connected to the tab bar. 我在向屏幕上的所有控制器添加标签栏时遇到问题,它仅在直接连接到标签栏的控制器中显示。 How can I show It in all screens? 如何在所有屏幕上显示它?

这是我目前的主要故事板

I found the answer, my problem was I didn't add navigation controller for each tab bar item, I made only one navigation controller that's why the tab bar didn't appear. 我找到了答案,我的问题是我没有为每个选项卡栏项添加导航控制器,我只做了一个导航控制器,这就是为什么没有显示选项卡栏的原因。 The right sequence is: 正确的顺序是:

TabBarItem1 -> NavController1 -> ViewController1 -> ViewController2 TabBarItem1-> NavController1-> ViewController1-> ViewController2

TabBarItem2 -> NavController2 -> ViewController1 -> ViewController2 TabBarItem2-> NavController2-> ViewController1-> ViewController2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM