该项目的标签栏没有显示,而是只显示一个黑屏。此标签栏在应用程序委托中的应用程序启动中实用地进入。
main_tab=[[UITabBarController alloc]init];
viewcontroller = [[HomeViewController alloc]init];
viewcontroller.title =@"Home";
UINavigationController *nav =[[UINavigationController alloc]initWithRootViewController:viewcontroller];
viewcontroller1 = [[SearchViewController alloc]init];
viewcontroller1.title =@"Search";
UINavigationController *nav1 =[[UINavigationController alloc]initWithRootViewController:viewcontroller1];
tabs_array=[[NSArray alloc]initWithObjects:nav,nav1, nil];
main_tab.viewControllers=tabs_array;
[self.window addSubview:main_tab.view];
[self.window makeKeyAndVisible];
return YES;