It seems the iOS Navigation Bar title color is white by default. Is there a way to change it to a different color?
I am aware of the navigationItem.titleView
approach using an image. Since my design skills are limited and I failed to get the standard glossy, I prefer changing the text color.
Any insight would be much appreciated.
Use the code below in any view controller viewDidLoad or viewWillAppear method.
This is one of those things that are missing. Your best bet is to create your own custom Navigation Bar, add a text box, and manipulate the color that way.
I've customized the navigationBar's background image and left button item, and the gray title not fit the background. Then I use:
to change the tint color to gray. And the title is white now! That's what I want.
Hope to help also :)
titleTextAttributes Display attributes for the bar’s title text.
@property(nonatomic, copy) NSDictionary *titleTextAttributes Discussion You can specify the font, text color, text shadow color, and text shadow offset for the title in the text attributes dictionary, using the text attribute keys described in NSString UIKit Additions Reference.
Availability Available in iOS 5.0 and later. Declared In UINavigationBar.h
I ran into the problem with my nav buttons throwing the text out of center (when you only have one button). To fix that I just changed my frame size like so:
In IOS 7 and 8, you can change the Title's color to let's say green