Color settings for iOS6 and iOS7 and more than 7 status bars

Source: Internet
Author: User

IOS7 default status bar text color is black


Modify the method to white: (Chenyong note my status bar style is still the default value for Gray style (default))

1 Set the view controller-based status bar appearance to No in Info.plist
2 Add in the Viewdidload method in the Viewcontroller that needs to change the color of the status bar:
[[UIApplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent];

As follows:

-(void) viewdidload{    [Super Viewdidload];     // Do any additional setup after loading the view from its nib.     [[UIApplication sharedapplication] setstatusbarstyle:uistatusbarstyleblacktranslucent];}

If you need to change color in all of the view, you can write it in the related method of the parent class.

Status bar merge issues encountered when using Cordova

- (void) Viewwillappear: (BOOL) animated{//View defaults to full size. If you want to customize the view's size, or its subviews (e.g. WebView),//You can do it here . //problems with the navigation and status bar merging    floatCurrentVersion =[[[ Uidevice Currentdevice] systemversion] floatvalue]; if(CurrentVersion >=7) {        //bounds is the origin of the coordinates in its upper left corner .CGRect viewbounds =[Self.webview bounds]; VIEWBOUNDS.ORIGIN.Y= -; ViewBounds.size.height= ViewBounds.size.height- -; Self.webView.frame=Viewbounds; Self.view.backgroundColor=[Uicolor Blackcolor]; } [Super viewwillappear:animated];}

Color settings for iOS6 and iOS7 and more than 7 status bars

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.