iOS 13 tabbar背景透明化和去掉分割线

configureWithTransparentBackground 需要放在设置好颜色的后面

 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];
}

你可能感兴趣的:(iOS 13 tabbar背景透明化和去掉分割线)