您的位置:首页 > 产品设计 > UI/UE

UINavigationController 与 UITabBarController

2016-01-12 11:08 393 查看
http://www.cnblogs.com/YouXianMing/p/3756904.html

// index start from 1.
UITabBarItem *newsItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:1];
//UITabBarItem *homeItem = [[UITabBarItem alloc] initWithTitle:@"首页" image:[UIImage imageNamed: @""] tag:1];
NewsViewController *newsController = [[NewsViewController alloc] init];
newsController.tabBarItem = newsItem;
[newsItem release];

UINavigationController *newsNav = [[UINavigationController alloc] initWithRootViewController:newsController];
[newsController release];

// repeat other here

NSArray *viewControllers = @[newsNav];
[newsNav release];

UITabBarController *tabController = [[UITabBarController alloc]init];
// tabController.viewControllers = @[newsNav];
[tabController setViewControllers:viewControllers animated:YES];

self.window.rootViewController = tabController;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: