我在 TabBarApplication 中有以下选项卡。我从我的主页导航到此 TabBar。
UIViewController *viewController1 = [[ExpenseRecorderViewController alloc] initWithNibName:@"ExpenseRecorderViewController" bundle:nil];
UIViewController *viewController2 = [[TaxCalculatorViewController alloc] initWithNibName:@"TaxCalculatorViewController" bundle:nil];
UIViewController *viewController3 = [[CurrencyConverterViewController alloc] initWithNibName:@"CurrencyConverterViewController" bundle:nil];
UIViewController *viewController4 = [[emiCalculatorViewController alloc] initWithNibName:@"emiCalculatorViewController" bundle:nil];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2,viewController3, viewController4, nil];
现在,如果我尝试通过以下方式设置这四个选项卡的标题 -
[[tabBarController.tabBar.items objectAtIndex:0] setTitle:@"title A"];
[[tabBarController.tabBar.items objectAtIndex:1] setTitle:@"title B"];
[[tabBarController.tabBar.items objectAtIndex:2] setTitle:@"title C"];
然后它不起作用。我想我需要在顶部设置导航栏的标题。但是怎么做呢?