修改tabbar颜色 适配iOS13

       if #available(iOS 13, *) {
            let appearance = UITabBarAppearance()
            appearance.stackedLayoutAppearance.selected.titleTextAttributes = [NSAttributedString.Key.foregroundColor:ColorUtil.main]
            self.tabBarVC.tabBar.standardAppearance = appearance
        }else{
            let appearance = UITabBarItem.appearance()
            appearance.setTitleTextAttributes([NSAttributedString.Key.foregroundColor:ColorUtil.main], for: .selected)
        }

你可能感兴趣的:(修改tabbar颜色 适配iOS13)