IOS modifies app's status bar color to white __ios

Source: Internet
Author: User

After IOS7, the system provides two ways to manage the status bar:

1. Through UIApplication management (the entire application's status bar is managed by it)

2. Through Uiviewcontroller management (each uiviewcontroller can have the unused status bar)


Mode one:


1. Code:

    UIApplication *myapplication = [uiapplication sharedapplication];
    Do not hide
    [MyApplication setstatusbarhidden:no];
    Set to White
    [MyApplication setstatusbarstyle:uistatusbarstylelightcontent Animated:yes];


2. Modify the properties of the Info.plist file: View controller-based status bar appearance = NO (meaning that the status bar is assigned to uiapplication Management) to achieve the entire app as white status bar effect




Mode two:


Individually modify the status bar color inside the Uiviewcontroller


/** Modify the current Uiviewcontroller status bar color is white * * *
-(Uistatusbarstyle) Preferredstatusbarstyle
{return
    uistatusbarstylelightcontent;
}



Related Article

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.