if (@available(iOS 13, *)) {
UITabBarAppearance *appearance = [self.tabBar.standardAppearance copy];
appearance.backgroundImage = [UIImage imageWithColor:[UIColor clearColor]];
appearance.shadowImage = [UIImage imageWithColor:[UIColor clearColor]];
// 官方文档写的是 重置背景和阴影为透明
[appearance configureWithTransparentBackground];
self.tabBar.standardAppearance = appearance;
} else {
self.tabBar.backgroundImage = [UIImage new];
self.tabBar.shadowImage = [UIImage new];
}
网友评论