简体   繁体   中英

Change title on “More” tab

有什么办法可以在“更多”标签上更改标题(uitabbaritem上的文字)?

well..If you want to change the title of the navigation bar of your more tab use the method given by 7KV7

and if you want to change the tab title ...

there is an another way..

suppose you have eight tabs..

1) In your tab Bar controller ...make only five tabs...remove all the other views other than five tabs..

2)lets make your fifth tab as your "more tab"...take it as a tableviewController and in it's tableView elements add elements as your sixth..seventh..eighth tab's name and image...

3)in fifthViewController's rowdidselect method navigate the sixth , seventh and eighth tab's respective view controllers..

Pros:-you can change the name and the image of the more tab
Cons:-well you can not use the edit button of your more tab where you can change the tab element's order..

try it if you are comfortable with this..

In your UITabBarController you just add this simple line under the viewDidLoad and under superViewDidLoad:

 self.moreNavigationController.navigationBar.topItem.title = @"Your Title";

So then it should look like this:

 - (void)viewDidLoad {
     [super viewDidLoad];   // Do any additional setup after loading the view.

     self.moreNavigationController.navigationBar.topItem.title = @"Mer"; 
     }

To make it worked I also created a new Objective-c class naming it: "MyTabBarController". And then I clicked my TabBarController in storyboard and set the class to: "MyTabBarController". When I pasted the code in the .m file it worked perfectly.

Taken from this Link

Yes, it is possible.

UINavigationBar *moreNavigationBar = tabBarController.moreNavigationController.navigationBar;
moreNavigationBar.topItem.title = @"Your title";

tabBarController is your UITabBarController

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM