iOS-修改Status Bar

时间:2022-01-16 15:29:42

一.在info.plist文件中添加一行不但要在 Status bar is initially hidden一行,选择为 YES。iOS-修改Status Bar

二.在didFinishLaunchingWithOptions方法里添加

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

     [UIApplication sharedApplication].statusBarHidden = NO;

     return YES;
}

statusBarHidden设置为NO就是显示状态栏。

statusBarHidden设置为YES就是隐藏状态栏。