문제

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

도움이 되었습니까?

해결책

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.

다른 팁

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];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top