0

如何获取 iOS 7 中默认标签栏图标的资源?

这样,我想在 TabBarItem 中使用现有的 Apple 图像(图标)和我自己的标题

4

1 回答 1

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];
}
于 2013-09-02T05:24:29.030 回答