将窗口?.rootViewcontroller设置为带有控制器数组的UINavigationController

时间:2017-04-08 12:48:42

标签: ios swift navigationbar controllers

在AppDelegate中,当我试图这样做时 -

window = UIWindow(frame: UIScreen.main.bounds)
window?.makeKeyAndVisible()
let controllerA = ControllerA()
let controllerB = ControllerB()

let nvc = UINavigationController()
nvc.viewControllers = [controllerA, controllerB]

window?.rootViewController = nvc

当我运行应用程序时,我的第二个控制器(ControllerB)隐藏了navigationBar或者丢失了,我根本看不到navigationBar,但是当我回到controllerA时,有一个navigationBar,为什么会发生?

我需要在secondController上安装navigationBar ...

[分辨

nvc.navigationBar.isTranslucent = false

0 个答案:

没有答案