【发布时间】:2011-10-23 16:37:26
【问题描述】:
我有一个基于标签栏的 iPhone 应用程序。
该应用由 2 个标签组成。 每个选项卡都有一个带有 3 个 ViewController 的导航控制器。
如何防止 TabBar 显示在其中一个 ViewController 中(因为它已经有自己的 TabBar 导航)?
【问题讨论】:
我有一个基于标签栏的 iPhone 应用程序。
该应用由 2 个标签组成。 每个选项卡都有一个带有 3 个 ViewController 的导航控制器。
如何防止 TabBar 显示在其中一个 ViewController 中(因为它已经有自己的 TabBar 导航)?
【问题讨论】:
找到了这个,感谢原始海报:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
if (appDelegate.navigationController.navigationBar.hidden == NO)
{
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
[appDelegate.navigationController setNavigationBarHidden:YES animated:YES];
[UIView beginAnimations:@"HideTabbar" context:nil];
[UIView setAnimationDuration:.2];
self.view.frame = CGRectMake(0,0,320,480);
[UIView commitAnimations];
}
if (appDelegate.navigationController.navigationBar.hidden == YES)
{
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];
[appDelegate.navigationController setNavigationBarHidden:NO animated:YES];
[UIView beginAnimations:@"ShowTabbar" context:nil];
[UIView setAnimationDuration:.2];
self.view.frame = CGRectMake(0,0,320,368);
[UIView commitAnimations];
}
}
【讨论】:
self.hidesBottomBarWhenPushed = YES; 谢谢!