TermiT
TermiT

Reputation: 144

Change title on "More" tab

Is there any way to change title on "More" tab (text on uitabbaritem)?

Upvotes: 0

Views: 1428

Answers (3)

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.

Upvotes: 0

Jean-Luc Godard
Jean-Luc Godard

Reputation: 1883

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..

Upvotes: 1

visakh7
visakh7

Reputation: 26400

Taken from this Link

Yes, it is possible.

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

tabBarController is your UITabBarController

Upvotes: 0

Related Questions