一.在info.plist文件中添加一行不但要在 Status bar is initially hidden一行,选择为 YES。
二.在didFinishLaunchingWithOptions方法里添加
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [UIApplication sharedApplication].statusBarHidden = NO; return YES;
}
statusBarHidden设置为NO就是显示状态栏。
statusBarHidden设置为YES就是隐藏状态栏。