开发者

UITabBar + UINavigationBar conflict title

I have a UITabBar and a UINavigationBar created in IB, when I launch my application everytime I navigate the UINavigation title change because I'm using

self.titl开发者_开发问答e = @"NAME"; 

my problem is that the UITabBarItem will change with the same name at the same time. I want to put a static name only for the UITabBarItem, how to do it in IB or programatically maybe.

Thanks,


try returning an explicit tabBarItem for your controller, and set its title yourself.

- (UITabBarItem *) tabBarItem {
    return [[[UITabBarItem alloc] initWithTitle: ...


I find the solution in this adress Stackoverflow navigationItem Title Sorry I didn't find it before posting my question.


try this, in your viewDidLoad

self.tabBarController.navigationItem.title = @"title";
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜