现在的位置: 首页 > 综合 > 正文

隐藏UITabBarController的tabBar

2017年12月08日 ⁄ 综合 ⁄ 共 307字 ⁄ 字号 评论关闭
隐藏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;

}

【上篇】
【下篇】

抱歉!评论已关闭.