我已经编写了以下代码来创建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截图。如何创建一个tabbar控制器,使其在ios5和ios6中看起来完全相同?
任何有用的帮助。