【发布时间】:2011-08-30 19:03:26
【问题描述】:
正如标题所说,我有一个 UINavigationController 嵌套在 UITabBarController 中。当用户点击表格单元格时,我想推送一个视图控制器(它不显示 UITabBar)。这是您点击“正在播放”时 iPod 应用程序的行为。
如何做到这一点?
【问题讨论】:
标签: iphone ios uitableview uinavigationcontroller uitabbarcontroller
正如标题所说,我有一个 UINavigationController 嵌套在 UITabBarController 中。当用户点击表格单元格时,我想推送一个视图控制器(它不显示 UITabBar)。这是您点击“正在播放”时 iPod 应用程序的行为。
如何做到这一点?
【问题讨论】:
标签: iphone ios uitableview uinavigationcontroller uitabbarcontroller
只需将其添加到您正在推送的视图控制器中即可。
- (BOOL)hidesBottomBarWhenPushed {
return YES;
}
【讨论】:
例如:
OrderViewController *controller = [[OrderViewController alloc] init];
controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:controller animated:YES];
[controller release];
或者尝试将self.tabBarController 的属性hidesBottomBarWhenPushed 设置为YES。
【讨论】:
从 Xcode 中的 UITabBarController 项目开始,在控制器的每个选项卡视图中放置一个 UINavigationController,就完成了!希望有帮助!
【讨论】:
我认为 hidesBottomBarWhenPushed 是要走的路。有一些问题要记住。您在要推送的 UIViewController 上设置此项,而不是在 tabBarController 或现有导航控制器上。
点击此处了解更多详情:Setting hidesBottomBarWhenPushed leaves bottom bar missing after View Controller is popped
从那篇文章中,一些示例代码:
self.anotherViewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:self.anotherViewController animated:animated];
【讨论】: