if(@available(iOS 13.0, *)) {
UITabBarAppearance *appearance = [self.tabBar.standardAppearance copy];
appearance.backgroundImage = [UIImage imageWithSize:self.tabBar.size color:[UIColor clearColor]];
appearance.shadowImage = [UIImage imageWithSize:self.tabBar.size color:[UIColor clearColor]];
[appearanceconfigureWithTransparentBackground];//透明度关键代码
self.tabBar.standardAppearance = appearance;
} else {
self.tabBar.backgroundImage = [UIImage imageWithSize:self.tabBar.size color:[UIColor clearColor]];
self.tabBar.shadowImage = [UIImage new];
}
网友评论