Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change the color of my text in my UINavigationBar on iOS 7?

How do I change the color of my text in my UINavigationBar on iOS 7? I want it white instead of black:

enter image description here

like image 396
Ethan Allen Avatar asked Sep 24 '13 19:09

Ethan Allen


People also ask

How do I change the color of my navigation bar text?

The text color of the navigation bar can be changed using two inbuilt classes: navbar-light: This class will set the color of the text to dark. This is used when using a light background color. navbar-dark: This class will set the color of the text to light.


1 Answers

If you're ok with a global change, you can put this in your App Delegate:

NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], UITextAttributeTextColor, nil];
[[UINavigationBar appearance] setTitleTextAttributes:attributes];
like image 130
Corey Avatar answered Sep 18 '22 02:09

Corey