Frage

How do I change the text color of the status bar? I know how to change the background color but not sure how to change the text color?

I need output like this:

enter image description here

I am not sure if it is at all possible under Apple HIG but just want to check if we could at all achieve this.

I have see this is done in the System App "Newsstand" . If you see the color is now exactly black or white. It is actually a light gray .

enter image description here

War es hilfreich?

Lösung

I Don't think you can change the text color of Status bar. @JMarsh its not duplicate que. The link you provided is for status bar style not for text.

Andere Tipps

There are some options to specify the look of the UIStatusBarStyle. For a single UIViewController use this method:

-(UIStatusBarStyle)preferredStatusBarStyle{ 
   return UIStatusBarStyleLightContent; 
}

For the whole app:

[[UIApplication sharedApplication] 
   setStatusBarStyle:UIStatusBarStyleBlackTranslucent];

There are a couple different styles defined here:

https://developer.apple.com/library/ios/documentation/uikit/reference/UIApplication_Class/Reference/Reference.html#//apple_ref/doc/c_ref/UIStatusBarStyle

To invoke:

[[UIApplication sharedApplication] setStatusBarStyle:statusBarStyle animated:NO];
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top