The question is plain easy and simple, the answer unfortunately not.
How can you change the font of the text in the UINavigationBar
?
The question is plain easy and simple, the answer unfortunately not.
How can you change the font of the text in the UINavigationBar
?
Not sure why all the answers included the shadow. Adding the lines that manipulate the shadow does nothing in respect to changing text font. These 2 lines of code will work for iOS 8.4 and Swift
The
titleTextAttributes
stores a dictionary that will dictate the font, color, size, and other attributes of the navigation bar's title.The above answer works. I would add the following line before the last line. If I don't, it seems the label is center-aligned incorrectly if there is a back button on the left side but no right button.
As of iOS 5 you can use the appearance proxy.
The answer is in a duplicate of this question: https://stackoverflow.com/a/12364740/883413
From iOS 7 and later:
From iOS 5 and later:
Earlier than iOS 5:
Updated for iOS 7:
courtesy of:
http://www.appcoda.com/customize-navigation-status-bar-ios-7/