Objective C: How to change text color in navigation bar

Zhen picture Zhen · Jul 24, 2011 · Viewed 44.2k times · Source

I have changed my navigation bar color via the following code

navconFvc.navigationBar.tintColor = [UIColor colorWithHexString:@"faf6f5"];

The code worked but the text color also needs to be changed (see screenshot below). Also the refresh button logo on the right is affected as well

enter image description here

The same issue occurs if I navigate to another page in the stack

enter image description here

Question: How can I change the color of the

  • title text
  • Back button text and
  • right bar button icon color?

After I changed the background color of the navbar?

Answer

Erwan picture Erwan · Mar 12, 2014

In iOS 7, just use:

self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};

Change [UIColor whiteColor] with whatever text color you want