本文主要是介绍button text attributes only respected for UIControlStateNormal...,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
//宏定义颜色
#define RGB_COLOR(R,G,B) [UIColor colorWithRed:R /255.0 green:G /255.0 blue:B / 255.0 alpha:1.0]
//在设置UITabBarCotroller字体颜色时,如果设置成高亮状态则会出现提醒:
[self.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:RGB_COLOR(255,40, 73)}forState:UIControlStateHighlighted];
//提醒如下
button text attributes only respected for UIControlStateNormal, UIControlStateSelected, UIControlStateFocused, and UIControlStateDisabled. state = 1 is interpreted as UIControlStateSelected.
//只需要将高亮状态改成选中状态即可去除打印出来的提醒
[self.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:RGB_COLOR(255,40, 73)}forState:UIControlStateSelected];
这篇关于button text attributes only respected for UIControlStateNormal...的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!