Reputation: 567
I cannot set font for Navigation Bar
in my NavigationController
using story board. I checked some questions here. They told options to change the font available in Attributes Inspector
. But when I checked there I can't select custom fonts for my NavigationBar
. You can see that in below screen shot.
You can see the Font Family field is disabled. So please help me to change the Navigation Bar
font from story board. Thanks in advance.
Upvotes: 4
Views: 919
Reputation: 171
You can add custom font with code if you want that font in all project just add it to didFinishLaunchingWithOptions
[[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor colorWithRed:245.0/255.0 green:245.0/255.0 blue:245.0/255.0 alpha:1.0], NSForegroundColorAttributeName,
[UIFont fontWithName:@"fontname" size:24.0], NSFontAttributeName, nil]];
Upvotes: 2
Reputation: 3070
Just change Custom to System and change again to Custom. Im not sure why, but this worked for me!
Upvotes: 14