在基于Tab的iPhone应用程序中,如何隐藏某些ViewControllers中的tabbar?

时间:2011-10-23 16:37:27

标签: iphone uitabbarcontroller

我有一个基于标签栏的iPhone应用程序。

该应用程序包含2个选项卡。 每个选项卡都有一个带有3个ViewControllers的导航控制器。

如何防止TabBar显示在其中一个ViewControllers中(因为它已经有自己的TabBar导航)?

1 个答案:

答案 0 :(得分:2)

发现这个,归功于原始的后期:

Is it possible to hide the tabbar when a button is pressed to allow a full screen view of the content?

- (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];
}   
}