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