我读过在iOS应用程序中有这样的结构是不好的。但是如果应用程序有很多UINavigationController
s和UITabBarController
s怎么办?但一个UINavigationBar
和一个UITabBar
总是只显示?其他UINavigationBar
s和UITabBar
s被隐藏。UINavigationController堆栈UITabBarControllers堆栈其他UINavigationControllers?
EDITED
例如,在基于导航的应用我把这种代码:
- (IBAction)openTabsController:(id)sender {
tabOneController *tabOneViewContr = [[[tabOneController alloc] initWithNibName:@"tabOneController" bundle:nil] autorelease];
UINavigationController *tabOneNavContr = [[UINavigationController alloc] initWithRootViewController:tabOneViewContr];
tabTwoController *tabTwoViewContr = [[[tabTwoController alloc] initWithNibName:@"tabTwoController" bundle:nil] autorelease];
UINavigationController *tabTwoNavContr = [[UINavigationController alloc] initWithRootViewController:tabTwoViewContr];
UITabBarController *tabContr = [[[UITabBarController alloc] init] autorelease];
tabContr.viewControllers = [NSArray arrayWithObjects:tabOneNavContr,tabTwoNavContr, nil];
sel.navigationController.navigationBar.hidden = YES;
[self.navigationController pushViewController:tabContr animated:YES];
}
调用此方法后我有两个UINavigationController
S和一个UITabBarController
。同时我在屏幕上有一个UINavigationBar
和一个UITabBar
。
EDITED
近似方案。
从一开始我们有一个UINavigationController的允许视图(圈子)之间进行导航。然后在推出UITabBar后出现并允许在视图之间切换。带有两个小矩形的矩形是具有带有2个UITabBarItem的UITabBar的视图。当我们按下任何UITabBarItem时,会出现另一个UIView。在这个UIView中,我们可以按下一些按钮,用另一个UITabBar调用另一个视图。推送后当前UITabBar可见,如果它没有与另一个UITabBar隐藏。 现在更清楚了吗? 上面的代码工作几乎是完美的(除了一些动画,而不是包括苹果的限制)
你应该发布一些代码或你的应用程序设计来理解你的问题。 – MaTTP
这段代码是否足以理解? – Gargo
构建这样的应用程序结构并不是我的想法。所以请不要downvote请 – Gargo