美文网首页
隐藏UITabbar

隐藏UITabbar

作者: 伊蕊飘零 | 来源:发表于2016-07-12 22:31 被阅读85次

//控制器出现的时候隐藏
-(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

      本文链接:https://www.haomeiwen.com/subject/swjsjttx.html