swift 关于tabbar设置未选中文字颜色失效问题

UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.blue], for: .selected)

这句好使

UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.red], for: .normal)

这句就不好使很蛋疼...

查了下资料说是设置TintColor

tabBar.unselectedItemTintColor = UIColor.red

试了试可以了

posted @ 2021-11-19 16:33  XL-MS  阅读(380)  评论(0编辑  收藏  举报