iOS13 隐藏tabbar顶部黑线以及tabbar透明度

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

    }

你可能感兴趣的:(iOS13 隐藏tabbar顶部黑线以及tabbar透明度)