Ios 嵌套的UINAvigationController和TabBarController
我在UI设计方面遇到了一些问题 备选案文1:Ios 嵌套的UINAvigationController和TabBarController,ios,ios8,uinavigationcontroller,uinavigationitem,Ios,Ios8,Uinavigationcontroller,Uinavigationitem,我在UI设计方面遇到了一些问题 备选案文1: 导航控制器 塔巴控制器 MapViewController UINavigationContoller UITableViewController 详细视图控制器 备选案文2: 导航控制器 塔巴控制器 MapViewController UITableViewController 详细视图控制器 在DetailViewController的navigationitem的备选方案1中,没有显示backButton和t
- 导航控制器
- 塔巴控制器
- MapViewController
- UINavigationContoller
- UITableViewController
- 详细视图控制器
- UITableViewController
- 塔巴控制器
- 导航控制器
- 塔巴控制器
- MapViewController
- UITableViewController
- 详细视图控制器
- 塔巴控制器
navigationitem
的备选方案1中,没有显示backButton
和title
,但我有较低的选项卡栏
在DetailViewController的navigationitem
的备选方案2中,可以看到backButton
和标题
,但我缺少下方的选项卡栏
有没有办法同时具备备选方案1和2的功能
我需要最顶部的导航控制器,因为在TabBarViewController中,我有一个显示侧菜单的LeftBarButtonim(SWRevealViewController)
编辑
TableViewController中的代码
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
poiDetail = [poiManager.listOfPois objectAtIndex:indexPath.row]; // does not work with regions-sections
[self performSegueWithIdentifier:@"poiDetail" sender:self];
}
其中“poitail”segue是一个推送,例如“Show”segue。嘿,我建议备选方案3:
- UINavigationController
- 选项卡栏控制器
- 导航控制器
- 地图视图控制器
- 导航控制器
- 表视图控制器
- 局部视图控制器
- 表视图控制器
- 导航控制器
- 选项卡栏控制器
您基本上希望由选项卡栏控制器管理的两个视图控制器包装在导航控制器中是的,我实现了相同的场景,面临相同的问题,幸运的是,我能够在我的应用程序中解决这一问题 我建议备选方案1 您可以在AppDelegate中设置初始UINavigationController,并使用相同的导航控制器维护应用程序流,直到嵌套UINavigationController。并将TabBar控制器设置为RootViewController
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
poiDetail = [poiManager.listOfPois objectAtIndex:indexPath.row]; // does not work with regions-sections
[self performSegueWithIdentifier:@"poiDetail" sender:self];
}
在嵌套NavigationController的RootViewController中,请隐藏AppDelegate NavigationController的导航栏。因此,您能够解决您所面临的备选方案1的问题
我参考了这个图书馆:
(注意:此库只是一个UINavigationController和TabbarController,您必须维护进一步嵌套的UINavigationController流)备选方案1应该可以工作。我不知道你是怎么编码的。你能在这里分享一些代码吗?ViewControllerFrom在table view controller中选择了哪些代码,而将其推到detailAdding
tabBarController
insidenavigationController
不是一个好主意。参考:您可以将navigationController添加到tabBarController的所有选项卡,然后可以将侧菜单的(SWRevealViewController)添加到所有导航控制器。(主要问题是侧菜单库中的大多数都不支持tabBarController)mapviewcontroller包装中的这一更改与另一分支中的detailviewcontroller有什么关系?这是一种更干净、更有组织的应用程序设置方式。它还可以解决细节视图控制器中没有navigationitem的问题。“后退”按钮是否存在于表视图控制器中,以及是否按到“细节视图”控制器,如[self.navigationController pushViewController:detailViewController animated:YES]代码>如何隐藏根UINavigationController的导航栏?appDelegate.navigationController.NavigationBar.hidden=true;=>通过将这一行添加到NestedNavigationController的RootViewControlleries中,它成功了,谢谢。我不需要在AppDelegate中保存引用,因为我使用的是SWRevealViewController,而且所有UIViewController都有指向它的指针。当细节视图从导航堆栈弹出时,我应该再次显示它。非常感谢。