隐藏UITabBarController的tabBar

隐藏UITabBarController的tabBar的时候,如果不做处理那么下方会多处49pix的白条或者其他颜色的条,解决这个问题的方法如下
- (void)setTabBarHidden:(BOOL)hidden
{
    [self.tabBar setHidden:hidden];
    UIView *contentView = [[self.view subviews] firstObject];
    CGRect frame = contentView.frame;
    if (hidden) {
        frame.size.height += 49;
    }
    else
    {
        frame.size.height -= 49;
    }
    contentView.frame = frame;

}

posted @ 2014-12-02 17:29  沙影无痕  阅读(272)  评论(0编辑  收藏  举报