Project requirements, different pages UI design in the top of each page of the status bar font color, need to dynamically switch.
The first step, info.plist set
添加View controller-based status bar appearance
The corresponding value of type bool NO
The second step, you need to Page Setup
- (void) viewWillAppear: (BOOL) animated call
-(void)viewWillAppear:(BOOL)animated{
[superviewWillAppear:animated];
[UIApplication sharedApplication].statusBarStyle =UIStatusBarStyleLightContent;
}
Note that this only black and white colors of the switching function and do not need to call preferredStatusBarStyle
Reproduced in: https: //www.jianshu.com/p/d90aa8f6a6f8