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
//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 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"];
精彩评论