-1

I want to change the view controller title color like that this one in black!

enter image description here

jscs
  • 63,694
  • 13
  • 151
  • 195
ema so
  • 119
  • 1
  • 7

2 Answers2

0

Try this add this code in viewWillAppear function:-

pass the font name according to your font

[self.navigationController.navigationBar setTitleTextAttributes:
 @{NSForegroundColorAttributeName:[UIColor blackColor],
NSFontAttributeName:[UIFont fontWithName:@"Helvetica-regular" size:17]}];
Irshad Ahmad
  • 1,363
  • 11
  • 17
0

Title color change for only one view controller:

Use below code in viewWillAppear

[self.navigationController.navigationBar setTitleTextAttributes:
 @{NSForegroundColorAttributeName:[UIColor blackColor]}];

Title color change for Entire Application:

Use below code in didFinishLaunching

[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor]}];
Subramanian P
  • 4,365
  • 2
  • 21
  • 25