美文网首页
去掉 UITabbar 分割线黑线

去掉 UITabbar 分割线黑线

作者: ace_xuke | 来源:发表于2019-10-18 15:59 被阅读0次
        CGRect rect = CGRectMake(0, 0, WF_SCREEN_WIDTH, WF_SCREEN_HEIGHT);
        UIGraphicsBeginImageContext(rect.size);
        CGContextRef context = UIGraphicsGetCurrentContext();
        CGContextSetFillColorWithColor(context, [[UIColor clearColor] CGColor]);
        CGContextFillRect(context, rect);
        UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
        if (@available(iOS 13.0, *)) {
            UITabBarAppearance *tabBarAppearance = [self.tabBar.standardAppearance copy];
            [tabBarAppearance setBackgroundImage:img];
            [tabBarAppearance setShadowColor:[UIColor clearColor]];
            [self.tabBar setStandardAppearance:tabBarAppearance];
        } else {
            [self.tabBar setBackgroundImage:img];
            [self.tabBar setShadowImage:img];
        }

相关文章

网友评论

      本文标题:去掉 UITabbar 分割线黑线

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