See the Internet said after iOS7 to set this
First, you need to add the key: Uiviewcontrollerbasedstatusbarappearance in the Info.plist configuration file, and set it to Yes;
Then, implement the following two methods in the Uiviewcontroller subclass:
- (Uistatusbarstyle) preferredstatusbarstyle{ return uistatusbarstylelightcontent;} - (BOOL) prefersstatusbarhidden{ return NO; Finally, when you need to refresh the status bar style, call the [self setneedsstatusbarappearanceupdate] method to refresh the note:
[Self setneedsstatusbarappearanceupdate] is invoked within the controller of push or present.
The strange thing is that I only after the login interface useful interface login Jump (the right to say that it should not jump when the network request data after the status bar color becomes black, and in the next interface how to set up is useless, Perhaps because I login interface is present past or what reason, do not discuss this color will change back , do not know whether this method has a problem, or my code has a problem.
Then I looked for one that was available in my project. Slightly modified, because I just entered the interface will have a Zhang Quan diagram .
call Setstatusbarstyle any iOS version availablein the plist file
in your code
if (isios7later) { [[uiapplication sharedapplication] setstatusbarhidden:no]; [[UIApplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent]; }
And I also found that ios6.0, the login interface has no status bar. (Login interface is not NAVG)
if (! Isios7later) {
[uiapplicationsharedapplication]. Statusbarhidden =NO;
}
。。。
Hey, exactly why ?
- (Uistatusbarstyle) Preferredstatusbarstyle
This method in another interface is not enough or later to study it is estimated to be my code problem.
About changing the status bar color after iOS7