How do I set custom navigation bar(title + titleView) for all navigation controllers and view controller?

大憨熊 提交于 2019-12-06 00:10:42

You could create a subclass of UIViewController, MyViewControllerWithBackButtonAndLogo (you can come up with a better name) then implement viewDidLoad to set up the navigation item. Make all your view controllers inherit from this base class. Then just make sure the view controllers call [super viewDidLoad] in their own implementations.

Also note that to set the back button title, you should not change the navigation item's title property, but set an appropriate backBarButtonItem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!