0

On one of my viewControllers I'm setting the NavigationBar programatically (to White with Black tint color)

All is well, but the text of the statusBar stays white (therefore not visible)

The code:

[self.navigationController.navigationBar setBarTintColor:[UIColor whiteColor]];
[self.navigationController.navigationBar setTintColor:[UIColor blackColor]];
[self.navigationController.navigationBar setTranslucent:NO];
Boaz
  • 4,864
  • 12
  • 50
  • 90

2 Answers2

0

You can change navigationBar.titleTextAttributes and set title color and font.

NSDictionary *navbarTitleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                            [UIColor redColor],UITextAttributeTextColor, 
                                            [UIColor blackColor], UITextAttributeTextShadowColor, 
                                            [NSValue valueWithUIOffset:UIOffsetMake(-1, 0)], UITextAttributeTextShadowOffset, nil];

[[UINavigationBar appearance] setTitleTextAttributes:navbarTitleTextAttributes];
Pavel Gatilov
  • 2,570
  • 2
  • 18
  • 31
  • I'm getting deprecation warnings... Anyway - I tried - NSDictionary *titleAttrs = self.navigationController.navigationBar.titleTextAttributes; [titleAttrs setValue:[UIColor blackColor] forKey:@"NSForegroundColorAttributeName"]; [self.navigationController.navigationBar setTitleTextAttributes:titleAttrs]; And it didn't work – Boaz Mar 16 '15 at 15:43
0

adding

[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;

Did the trick...

Boaz
  • 4,864
  • 12
  • 50
  • 90