Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 按下时隐藏UITabBar,同时保持接触_Iphone_Objective C_Ios_Uitabbarcontroller - Fatal编程技术网

Iphone 按下时隐藏UITabBar,同时保持接触

Iphone 按下时隐藏UITabBar,同时保持接触,iphone,objective-c,ios,uitabbarcontroller,Iphone,Objective C,Ios,Uitabbarcontroller,我需要在一个视图控制器上隐藏uitabar。我试过了 vc.hideTabBarwhenpushed = TRUE 推的时候,;这很好,但是当我在这个视图控制器上打开一个UITable时,在uitabar应该在的底部,我的UITable没有接触到。 我试过了 [viewController setWantsFullScreenLayout:YES]; 但它不起作用。使用此代码隐藏和显示选项卡栏 //隐藏选项卡栏的步骤 - (void) hideTabBar:(UITabBarControll

我需要在一个视图控制器上隐藏
uitabar
。我试过了

vc.hideTabBarwhenpushed = TRUE
推的时候,;这很好,但是当我在这个视图控制器上打开一个
UITable
时,在
uitabar
应该在的底部,我的
UITable
没有接触到。 我试过了

[viewController setWantsFullScreenLayout:YES];

但它不起作用。

使用此代码隐藏和显示选项卡栏

//隐藏选项卡栏的步骤

- (void) hideTabBar:(UITabBarController *) tabbarcontroller 
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.5];
    for(UIView *view in tabbarcontroller.view.subviews)
    {
        if([view isKindOfClass:[UITabBar class]])
        {
            [view setFrame:CGRectMake(view.frame.origin.x, 480, view.frame.size.width, view.frame.size.height)];
        } 
        else 
        {
            [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)];
        }

    }

    [UIView commitAnimations];
} 
- (void) showTabBar:(UITabBarController *) tabbarcontroller 
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.5];
    for(UIView *view in tabbarcontroller.view.subviews)
    {
        if([view isKindOfClass:[UITabBar class]])
        {
            [view setFrame:CGRectMake(view.frame.origin.x, 431, view.frame.size.width, view.frame.size.height)];
        } 
        else 
        {
            [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 431)];
        }
    }
    [UIView commitAnimations]; 
}
//显示选项卡栏的步骤

- (void) hideTabBar:(UITabBarController *) tabbarcontroller 
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.5];
    for(UIView *view in tabbarcontroller.view.subviews)
    {
        if([view isKindOfClass:[UITabBar class]])
        {
            [view setFrame:CGRectMake(view.frame.origin.x, 480, view.frame.size.width, view.frame.size.height)];
        } 
        else 
        {
            [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)];
        }

    }

    [UIView commitAnimations];
} 
- (void) showTabBar:(UITabBarController *) tabbarcontroller 
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.5];
    for(UIView *view in tabbarcontroller.view.subviews)
    {
        if([view isKindOfClass:[UITabBar class]])
        {
            [view setFrame:CGRectMake(view.frame.origin.x, 431, view.frame.size.width, view.frame.size.height)];
        } 
        else 
        {
            [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 431)];
        }
    }
    [UIView commitAnimations]; 
}

您需要确保正确设置了表视图的弹簧和支柱:


您使用的是
UITableViewController
?我需要检查其用户交互,iAppleit隐藏了选项卡栏,但我仍然无法接触到UITableView的UItabbar位置。。