在模态视图上显示标签栏

Show tab bar on modal View


单击按钮 "Go!" 显示白色视图控制器。
我想在白色 ViewController 上显示标签栏,但它没有显示。我如何正确地做到这一点? Swift拜托,谢谢。

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

Swift代码:

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

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

我认为你使用了错误的 segue 只需删除旧的 segue 并通过按控制键这样添加新的 segue:

在firstView中这样做,所以firstViewController嵌入到NavigationController中,然后进行push segue,tabBar不会消失。