Run the application with Xcode5. The first result is the status bar change. In iOS6, the status bar is being processed by the system and does not need to be considered in the application. After iOS7, the application is processing. Each ViewController can control the status bar.
The status bar in iOS7 is transparent and will display the following content together. For example, my application colors are deep and I hope the icons on the status bar will be light. So I need to do two steps:
1. Set View controller-based status bar appearance to NO in info. plist.
2. In the AppDelegate. m file, add the didfinishlaunchingwitexceptions method.
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; [[UIApplication sharedApplication] setStatusBarHidden:NO];
In this way, the status bar in the application is changed to a light color style.
If some viewController applications require special settings for the status bar, they need to be processed in the corresponding viewController. In this case, you need to rewrite two APIs, preferredStatusBarStyle and prefersStatusBarHidden.
-(UIStatusBarStyle)preferredStatusBarStyle{ return UIStatusBarStyleLightContent;}
- (BOOL)prefersStatusBarHidden{ return YES;}Then, call [self setNeedsStatusBarAppearanceUpdate] to refresh the status bar style.
In iOS7, the status bar is floating on the upper layer, so that if the window itself moves down 20 pixel, it can be perfectly displayed. This method should be set up theoretically. I tried it but it was not successful. If it was successful, please tell me how to do it.