去掉 UITabbar 分割线黑线

        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 分割线黑线)