导航控制器标题未显示 [英] Navigation Controller Header is not showing
本文介绍了导航控制器标题未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以,这里我基本上有这个布局
So, here I basically have this layout
但是当我成功构建时,我看不到导航控制器的标题.
but when I build successfully I am not able to see the title of the navigation controller.
我能做什么?
推荐答案
这是你想要效仿的:
- 将
UITabBarController
设置为是初始视图控制器 - 为每个场景添加一个关系,不管它是不是
UINavigationController
- 如果一个场景是一个
UINavigationController
,它的行为就像任何根导航控制器一样,有自己的视图堆栈、后退按钮等等.
- Set the
UITabBarController
as is Initial View Controller - add a relationship to each scene, whether it is a
UINavigationController
or not - If a scene is a
UINavigationController
, it will behave like any root navigation controller, with its own view stack, back button, an so forth.
运行上面的应用程序,然后点击项目 2 将显示此导航控制器:
Running the app above, then tapping on Item 2 will present this navigation controller:
如果您无法在启动时将 UITabBarController
设为初始视图控制器,您可以稍后使用此技术使其成为 root:
If you cannot make the UITabBarController
the initial View Controller at launch, you can make it become root later on using this technique:
let newViewController = self.storyboard?.instantiateViewControllerWithIdentifier("id")
as? UIViewController
self.view.window?.rootViewController = newViewController
这将展示上面的架构,尽管没有动画(也没有任何导航方式).非常适合入职或登录屏幕.
This will present the architecture above, albeit without animation (nor any way to navigate back). Perfect for onboarding or login screens.
在 Xcode 7+、iOS 9+
这篇关于导航控制器标题未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文