MattTheHack MattTheHack - 24 days ago 7
Objective-C Question

How to use a custom font in iOS tab bar

I'm using the font awesome resource for the UI of my iPhone application :
FontAwesome

I have used it within my app screens like follows :

Phone.font = [UIFont fontWithName:kFontAwesomeFamilyName size:40];
Phone.text = [NSString fontAwesomeIconStringForIconIdentifier:@"fa-phone"];


But now I want to use it in the tab bar items of my tab bar controller i.e I want to set the icons of the tab bar to font awesome elements. How can this be done?

Answer

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:

[[UITabBarItem appearance] setTitleTextAttributes:@{
                                                    NSFontAttributeName:[UIFont fontWithName:@"AmericanTypewriter" size:20.0f]
                                                    } forState:UIControlStateNormal];

here is some more reference

how-to-change-the-color-of-text-in-uitabbaritem-in-ios-5

ios5-tabbar-fonts-and-color