我已经编写了以下代码来创建 UITabBarController
{
NSMutableArray *arr = [[NSMutableArray alloc]init];
STPC_AgendaController *agendaController = [[STPC_AgendaController alloc]initWithNibName:@"STPC_AgendaController" bundle:nil];
STPC_Sponserer *Sponserer = [[STPC_Sponserer alloc]initWithNibName:@"STPC_Sponserer" bundle:nil];
Sponserer.tabBarItem.title = @"Sponsors";
STPC_AboutUsViewController *aboutUs = [[STPC_AboutUsViewController alloc]initWithNibName:@"STPC_AboutUsViewController" bundle:nil];
aboutUs.tabBarItem.title = @"About us";
UINavigationController *agendaNavigation = [[UINavigationController alloc]
initWithRootViewController:agendaController];
agendaNavigation.tabBarItem.title = @"Agenda";
self.navigationController.navigationBarHidden = YES;
self.tabController = [[UITabBarController alloc]init];
[arr addObject:agendaNavigation];
[arr addObject:Sponserer];
[arr addObject:aboutUs];
[self.tabController setViewControllers:arr animated:YES];
[self resignFirstResponder];
[self.view addSubview:self.tabController.view];
}
但是它在 ios5 中的作用不同:
和ios6:
ios5 和 ios6 的 PFA 屏幕截图。如何创建一个标签栏控制器,使其在 ios5 和 ios6 中看起来完全一样?
任何帮助appriciated。