iOS 之 UITabBar 设置标题 Console 提示: button text attributes only respected for ......

问题现象:

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)

你可能感兴趣的:(iOS 之 UITabBar 设置标题 Console 提示: button text attributes only respected for ......)