Reputation: 3527
How to change the unselected tabbaritem color in iOS7? This does not work.
I'm trying this
[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:[ThemeManager customFont] size:10.0f],
NSForegroundColorAttributeName : [UIColor greenColor]
} forState:UIControlStateSelected];
Colour changes but not the custom font I'm using.
Upvotes: 1
Views: 104
Reputation: 3527
Found the solution.
[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont fontWithName:[ThemeManager customFont] size:17.0f],
NSForegroundColorAttributeName: [UIColor greenColor]}
forState:UIControlStateSelected];
[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont fontWithName:[ThemeManager customFont] size:17.0f],
NSForegroundColorAttributeName: [UIColor blackColor]}
forState:UIControlStateNormal];
Upvotes: 1