IOS从标签栏项目执行segue
我有一个带有2个项目的Tab栏控制器。第一项是包含表视图的VC。单击一个单元格,执行一个segue到其他视图控制器(不是标签栏控制器上的项目)。
I have a Tab bar controller with 2 items. The first item is a VC which contains a table view. Clicking on a cell, performs a segue to some other view controller (not an item on the tab bar controller).
问题是它在segue时删除了标签栏完成。
如何将项目1替换为其他VC并仍然将标签栏保留在底部?
The problem is that it removes the tab bar when segue completes. How can I just replace the item 1 with other VC and still keep the tab bar in the bottom?
你需要嵌入你的 Item1VC
到 NavigationController
这样当你从 ItemVC
推送到 MoviesViewController
它不会删除标签栏,如果你没有嵌入 NavigationController
那么它将从主 ViewController 在你的情况下它是 TabbarController
,这样你就看不到tabbar了。
You need to embed your Item1VC
to NavigationController
so that when you push from ItemVC
to MoviesViewController
it will not remove the tabbar, if you doesn't embed the NavigationController
then it will push from the main ViewController
in your case it is TabbarController
so that you are not able to see the tabbar.