UITabbar 线颜色的更改

使用系统tabbar样式,并切改变系统tabbar上方线的颜色的方法:

给你一个方法,可保留系统tabbar的毛玻璃效果,并成功更改顶部线的颜色。

- (void) changeTopBarLineColor
{
    //去除系统线
    [UITabBar appearance].clipsToBounds = YES;
    
    //添加自定义线
    UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, PBSCREEN_WIDTH, 0.5)];
    lineView.backgroundColor = [UIColor pb_colorWithHexString:c_whiteTwo_line];
    
    [[UITabBar appearance] addSubview:lineView];
}

You're welcome!

你可能感兴趣的:(UITabbar 线颜色的更改)