在模态视图

时间:2015-08-06 11:08:30

标签: ios xcode swift storyboard uitabbarcontroller


点击按钮" Go!"显示白色视图控制器。
我想在白色ViewController上显示tabbar,但它没有显示。我怎么做到这一点?斯威夫特,谢谢。

storyboard screen

3 个答案:

答案 0 :(得分:2)

在firstView中执行此操作,因此firstConController嵌入在NavigationController中,然后进行推送segue,tabBar将不会被忽略。

enter image description here

答案 1 :(得分:1)

您必须使用导航控制器才能看到标签栏。通过以模态方式呈现,您无法在白色控制器中获得标签栏。

Swift代码:

let secondViewController = self.storyboard.instantiateViewControllerWithIdentifier("SecondViewController") as SecondViewController

self.navigationController.pushViewController(secondViewController, animated: true)  

答案 2 :(得分:0)

我认为你正在使用错误的segue只需删除旧的segue并通过按下控制键enter image description here以这种方式添加新的segue: