iOS 之 UITabBar 设置标题 Console 提示:
2018-02-24 本文已影响0人
willokyes
问题现象:
2018-02-24 14:17:32.518 WeiBo[6691:205592] button text attributes only respected for UIControlStateNormal, UIControlStateSelected and UIControlStateDisabled. state = 1 is interpreted as UIControlStateSelected.
vc.tabBarItem.setTitleTextAttributes([NSAttributedStringKey.foregroundColor: .orange],
for: .highlighted)
改为:
vc.tabBarItem.setTitleTextAttributes([NSAttributedStringKey.foregroundColor: .orange],
for: .selected)