小编use*_*391的帖子

UITabBarItem外观-setTitleTextAttributes保持记录"state = 1被解释为UIControlStateHighlighted"?

在我的AppDelegate实现文件中,我使用这些代码行来设置tabBarItems的自定义字体和颜色:

[[UITabBarItem appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor grayColor], UITextAttributeTextColor, 
[UIFont fontWithName:@"Arial" size:0.0], UITextAttributeFont, 
nil] forState:UIControlStateNormal];

[[UITabBarItem appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor whiteColor], UITextAttributeTextColor, 
[UIFont fontWithName:@"Arial" size:0.0], UITextAttributeFont, 
nil] forState:UIControlStateHighlighted];
Run Code Online (Sandbox Code Playgroud)

对于某些(未知)原因,将记录以下消息,每个tabBarItem一个:

button text attributes only respected for UIControlStateNormal, UIControlStateHighlighted and UIControlStateDisabled. state = 1 is interpreted as UIControlStateHighlighted.
Run Code Online (Sandbox Code Playgroud)

使用标准搜索引擎找不到任何东西,所以我寻求你的帮助.我做错了什么以及如何解决这个问题?

提前感谢您的任何建议.

iphone ios ios5

19
推荐指数
2
解决办法
1万
查看次数

标签 统计

ios ×1

ios5 ×1

iphone ×1