如何在iOS 7中获取默认标签栏图标的资源?
这样,我想在标签栏项目中使用现有的Apple图像(图标)和我自己的标题
答案 0 :(得分:0)
你好,你可以这样试试,
-(void)loadTabBarView
{
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
self.navViewController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
self.navViewController.navigationBar.barStyle=UIBarStyleBlack;
self.navViewController.navigationBar.hidden=TRUE;
self.navViewController.tabBarItem.title = @"Home";
[self.navViewController.tabBarItem initWithTabBarSystemItem:UITabBarSystemItemContacts tag:1];
self.vcMenuViewController = [[MenuViewController alloc] initWithNibName:@"MenuViewController" bundle:nil];
self.navMenuViewController = [[UINavigationController alloc] initWithRootViewController:self.vcMenuViewController];
self.navMenuViewController.navigationBar.barStyle=UIBarStyleBlack;
self.navMenuViewController.navigationBar.hidden=TRUE;
self.navMenuViewController.tabBarItem.title = @"Menu";
[self.navMenuViewController.tabBarItem initWithTabBarSystemItem:UITabBarSystemItemDownloads tag:2];
NSArray *arrayWithController = [NSArray arrayWithObjects:self.navViewController,self.navMenuViewController,nil];// self.navNewsTab, nil];
self.tabBar=[[UITabBarController alloc]init];
self.tabBar.moreNavigationController.navigationBar.barStyle = UIBarStyleBlack;
[self.tabBar setViewControllers:arrayWithController];
}