TabBarController在NavigationConroller
问题描述:
我有一个的UITabBarController一个UINavigationController中,我知道了UINavigationController的iOS的文件说以下内容:TabBarController在NavigationConroller
rootViewController
The view controller that resides at the bottom of the navigation stack. This object cannot be an instance of the UITabBarController class.
那么,这是否意味着,如果我有UIViewControllers已导航堆栈上,它的确定然后推一个UITabBarController,一旦它不是根项目?
我现在有这个,除了当我弹出UITabBarController时,dealloc或viewDidUnload没有在任何TabBarItems ViewController中调用时,我是否需要做类似于使viewWillAppear工作的事情?
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
[viewController viewWillAppear:NO];
}
感谢
答
我不知道,有一个UINavigationController内的UITabBarController是去工作。
我通常这样做的另一种方式圆
companyNavController = [[[UINavigationController alloc] initWithRootViewController:companyViewController] autorelease];
companyNavController.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemSearch tag:1];
[tabBarController setViewControllers:[NSArray arrayWithObjects:phoneBookNavController, companyNavController, faveNavController, settingsNavController, nil]];
如果你想隐藏自己的应用程序的一部分的TabBar,你总是可以尝试hidesBottomBarWhenPushed来管理这一点。
HTH