如何更改页面标题而不更改标签栏项目的标题?

时间:2011-10-06 07:05:07

标签: objective-c title uitabbaritem

我希望能够在不影响标签栏标题的情况下更改页面标题。我目前的实施如下:

//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];

点击问题标签之前

enter image description here

//After changing the title's page in view did load of "ForYouViewController"
- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title = @"Latest";
}

点击问题标签(标签栏标题已更改)

enter image description here

如何设置页面标题,使其不会改变标签栏的描述?

1 个答案:

答案 0 :(得分:0)

你可以试试这个

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

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