开发者

How to change page title without changing tab bar item's title as well?

I want to be able to change the page's title without affecting the tab bar's title. My current implementation is as follows:

//Setting page and UITabbar title in app delegate
ForYouViewController *fuvc = [[ForYouViewController alloc]init];
fuvc.title = @"Questions";
UITabBarItem *tempTabBarItem1 = [[UITabBarItem alloc]initWithTitle:@"Questions" image:nil tag:QUESTIONTAB_INDEX];

Before clicking on questions tab

How to change page title without changing tab bar item's title as well?

//After changing the title's page in view did load of "ForYouViewController"
- (void)viewDidLoad
{
    [super view开发者_运维百科DidLoad];
    self.title = @"Latest";
}

After clicking on questions tab (tab bar title changed)

How to change page title without changing tab bar item's title as well?

How can I set the the page title such that it does not alter the tab bar's description?


You can try this

YourAppDelegate *appDelegate = (YourAppDelegate *)[[UIApplication sharedApplication] delegate];

[appDelegate tempTabBarItem1] setTitle:@"Questions"];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜