How do I change the color of my text in my UINavigationBar on iOS 7? I want it white instead of black:
Asked
Active
Viewed 3,315 times
6
-
1See `UINavigationBar textTitleAttributes` – rmaddy Sep 24 '13 at 19:03
-
1I've answer to somthing similar before: http://stackoverflow.com/a/18934411/2796060 – RFG Sep 24 '13 at 19:10
1 Answers
13
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];

Corey
- 5,818
- 2
- 24
- 37
-
3Why the old syntax? `@{UITextAttributeTextColor: [UIColor whiteColor]}` – Brian Nickel Sep 24 '13 at 19:16
-
1
-
10For iOS 7 and so forth, use NSForegroundColorAttributeName instead of UITextAttributeTextColor. – Andrew Zimmer Nov 25 '13 at 21:57