I have an tab bar application with navigation controllers on certain tabs. If I set a title in initWithNib, that title appears on both the navigation and on the tab.
Both the navigation controller and the tab bar item use that title.
Is it possible to have a different title on the navigation and the tab bar item? Or, more specifically, not to display the title on the navigation bar (I am using a graphic there and don't want the text displayed over my graphic).
Solved.
Setting self.title specifies the tab title, specifying self.navigationItem.title will override the self.title and set the navigation title. In my case, I set it to nil so no title would show in the navigation bar.
TabBar与导航栏标题设置
本文介绍如何在iOS应用中为TabBar和导航栏分别设置不同的标题。通过指定self.title和self.navigationItem.title属性,可以实现仅在TabBar显示标题而在导航栏不显示文字的效果。
206

被折叠的 条评论
为什么被折叠?



