Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITabBarItem appearance -setTitleTextAttributes keeps logging "state = 1 is interpreted as UIControlStateHighlighted"?

Tags:

In my AppDelegate implementation file I use these lines of code to set custom fonts and colors of 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];

For some (unknown) reason the following messages get logged, one for each tabBarItem:

button text attributes only respected for UIControlStateNormal, UIControlStateHighlighted and UIControlStateDisabled. state = 1 is interpreted as UIControlStateHighlighted.

Couldn't find anything using the standard search engines, so I seek your help. What am I doing wrong and how to fix this?

Thank you in advance for any suggestions.

like image 966
user1433391 Avatar asked Jun 10 '12 19:06

user1433391


1 Answers

Just change the "UIControlStateHighlighted" to "UIControlStateSelected". Hope this helps!

like image 129
Levi Avatar answered Sep 17 '22 01:09

Levi