我正在尝试将 TTThumbsViewController 放在 UITabBarController 中,但是当我这样做时,TTThumbsViewController 的 NavigationBar 不显示。NavigationBar 应该在的地方只有空白。我自己只加载了 TTThumbsViewController,而 NavigationBar 加载得很好。我确定我只是错过了一个设置,但我无法弄清楚它是什么。
下面是我创建 UITabBarController 和 TTThumbsViewController 的方法:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.tabBarController = [[UITabBarController alloc] init];
ThumbsViewController *thumbsViewController = [[ThumbsViewController alloc] init];
UITabBarItem *thumbsTabBarItem = [[UITabBarItem alloc] initWithTitle:@"Thumbs" image:[UIImage imageNamed:@"icon.png"] tag:Thumbs];
thumbsViewController.tabBarItem = thumbsTabBarItem;
self.tabBarController.viewControllers = [NSArray arrayWithObjects:thumbsViewController, nil];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}