This article is selected from StackOverflow ("SOF") featured Quiz Summary series of articles, this series of articles will be for the reader to share the best quality of the foreign excellent questions and answers for readers to learn and understand the latest foreign technology, this article Talk about iOS 7 How to modify the status bar text color.
Problem:
Oleksandr Veremchuk
I have this application background color is darker, but the iOS 7 status bar is transparent, so I can not see anything, only see the corner of the green battery display. How can I change the status bar color to white, just like the home screen?
Reply:
Peter B. Kramer
1. Set Uiviewcontrollerbasedstatusbarappearance to YES in the format
2. Do [self setneedsstatusbarappearanceupdate] in viewdidload;
3. Add the following code
| 123 |
-(UIStatusBarStyle)preferredStatusBarStyle{ returnUIStatusBarStyleLightContent; } |
Wilsontgh
Alternatively, you can choose to exit View-controller based on the appearance of the status bar
1. Set Uiviewcontrollerbasedstatusbarappearance to NO.
2. Call [[UIApplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent];
Lucas
In fact, without writing any code can be achieved.
Follow the steps below to show the status bar text in the entire app as white:
In the project format file
- Status Bar Style:uistatusbarstylelightcontent
- View controller-based status Bar Appearance:no
- Status Bar is initially hidden:no
Pradeep Mahdevu
Set ' View controller-based status bar appearance ' to NO in Info.plist
Add in Appdelegate:
| 1 |
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; |
To
| 1234 |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ ...... ...} |
Stepik21
It's useless to me, here's my solution:
Add in Info.plist
Uiviewcontrollerbasedstatusbarappearance, set the value to NO
And then didfinishlaunchingwithoptions the appdelegate, add the code:
| 12 |
[application setStatusBarHidden:NO];[application setStatusBarStyle:UIStatusBarStyleLightContent]; |
Original link: How to change Status Bar text color in IOS 7
article selected from StackOverflow community, in view of its content for the developer help, will now be translated into this article, for your reference and learning. The 9Tech will continue to be updated daily, and readers can click on the stackoverflow (SOF) Select Quiz Summary to view all translated content. At the same time, we also recruit like-minded technical friends to co-translate for the benefit of everyone!
Summary of status bar modifications after iOS7