隐藏UITabbar


//控制器出现的时候隐藏
-(void)viewWillAppear:(BOOL)animated
{
    
    NSArray *array=self.tabBarController.view.subviews;
    //决定要隐藏的
    UIView *view=array[2];
    
    view.frame=CGRectMake(0, [UIScreen mainScreen ].bounds.size.height, [UIScreen mainScreen ].bounds.size.width, 49);
    
    [UIView commitAnimations];
    
}

- (void)viewWillDisappear:(BOOL)animated
{
    
    NSArray *array=self.tabBarController.view.subviews;
    
    UIView *view=array[2];
    
    view.frame=CGRectMake(0, [UIScreen mainScreen ].bounds.size.height-49, [UIScreen mainScreen ].bounds.size.width, 49);
    
    [UIView commitAnimations];
}

你可能感兴趣的:(隐藏UITabbar)