Modify the display color of StatusBar in iOS7

Source: Internet
Author: User

Modify the display color of StatusBar in iOS7

As follows:

To manually modify the color of the StatusBar in IOS7, the first step is to set the View controller-based status bar appearance value to No in the plist file.

The second step is implemented in the code, as follows:

////ROOTVIEWCONTROLLER.M//StatusBar////Copyright (c) 2014 y.x. All rights reserved.//#import "RootViewController.h"@interfaceRootviewcontroller ()@end@implementationRootviewcontroller- (void) viewdidload{[Super Viewdidload]; Self.view.backgroundColor=[Uicolor Whitecolor]; //Change status after 4 seconds[Self performselector: @selector (delayrun) withobject:nil Afterdelay:4. f];}- (void) delayrun{//animate change background color[UIView animatewithduration:1animations:^{Self.view.backgroundColor=[Uicolor Blackcolor];        }]; /*The parameters uistatusbarstylelightcontent Uistatusbarstyledefault can be selected*/    //Animate change StatusBar display color[[UIApplication sharedapplication] Setstatusbarstyle:uistatusbarstylelightcontent Animated:yes];}@end

Here are some things to note about the implementation details:

Modify the display color of StatusBar in iOS7

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.