1

I tried to change title color like this, but it has no effect.

NSDictionary *navbarTitleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, nil];
[[UINavigationBar appearance] setTitleTextAttributes:navbarTitleTextAttributes];

Maybe the problem that navigationbar style is black?

self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
János
  • 32,867
  • 38
  • 193
  • 353

2 Answers2

1

Try this :

self.navigationItem.title = @"The title";
self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor redColor] forKey:NSForegroundColorAttributeName];
Sathish Kumar VG
  • 2,154
  • 1
  • 12
  • 19
0

Use UITextAttributeTextColor instead of NSForegroundColorAttributeName for the key, and it will work :)

Hyder
  • 1,163
  • 2
  • 13
  • 37