Hi I have this code and it doesn't work, what am I doing wrong?
- (void)viewDidLoad
{
[self.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"AmericanTypewriter" size:20.0f], UITextAttributeFont, nil] forState:UIControlStateDisabled];
}
BTW that's not the only thing in my viewDidLoad but I just wanted to show you guys thats where I put it.
As per: How to change the Color of text in UITabBarItem in iOS 5
It looks like the solution may be sending the message to the appearance proxy, instead of one item:
(Deprecated in iOS 7.0+)
[[UITabBarItem appearance] setTitleTextAttributes:@{UITextAttributeFont: [UIFont fontWithName:@"AmericanTypewriter" size:20.0f]} forState:UIControlStateNormal];
For iOS 7.0+ use:
[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont fontWithName:@"AmericanTypewriter" size:20.0f]} forState:UIControlStateNormal];