【发布时间】:2016-05-17 05:40:02
【问题描述】:
我有一个这样的故事板
-> NavigationController -> LoginView -> TabBarController -> VC1 -> VC2
我没有设法从 VC1“移动”到 VC2 并保持标签栏。
我尝试了以下方法:
-
Segue(显示类型)
self.performSegueWithIdentifier("toVC2segue", sender: self) -
以编程方式实例化:
// prepare for future display let storyboard = UIStoryboard(name: "Main", bundle: nil) let navigationVC = UIApplication.sharedApplication().keyWindow?.rootViewController as! UINavigationController // prepare next view let vc = storyboard.instantiateViewControllerWithIdentifier("VC2id") self.tabBarController?.navigationController?.pushViewController(vc, animated: true)
但两者都会使标签栏消失。
我也试过了
self.hidesBottomBarWhenPushed = false
但这并没有改变任何东西。
你还有什么想法吗?
PS : 我更新了上面的方案...
编辑:阅读下面的答案后,我尝试添加另一个导航控制器:
-> NavigationController -> LoginView -> TabBarController -> NavigationController -> VC1 -> VC2
但我现在在 VC1 和 VC2 中叠加了 2 个导航栏...
【问题讨论】: