开发者

Change title on "More" tab

Is there any way to chang开发者_运维知识库e title on "More" tab (text on 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..


Taken from this Link

Yes, it is possible.

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

tabBarController is your UITabBarController


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜