Summary of status bar modifications after iOS7

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.