Reputation: 35128
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;
Upvotes: 1
Views: 2169
Reputation: 2172
Try this :
self.navigationItem.title = @"The title";
self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor redColor] forKey:NSForegroundColorAttributeName];
Upvotes: 1
Reputation: 1173
Use UITextAttributeTextColor
instead of NSForegroundColorAttributeName
for the key, and it will work :)
Upvotes: 0