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

2020-04-24  本文已影响0人  奋斗吧程序员

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

    }

上一篇 下一篇

猜你喜欢

热点阅读