1.首先在plist文件中添加一key值:View controller-based status bar appearance设置为NO
2.在AppDelegate中添加代码:
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
// Override point for customization after application launch.
//状态栏设为白色
[UIApplicationsharedApplication].statusBarStyle=UIStatusBarStyleLightContent;
self.window=[[UIWindowalloc]initWithFrame:[UIScreenmainScreen].bounds];
}