How to hide iOS status bar

2019-01-01 17:04发布

In my iOS video app status bar is hidden in some view controllers. I have done this using following code.

[[UIApplication sharedApplication] setStatusBarHidden:YES];
  • It works for iOS 5 and iOS 6 , but not in iOS 7.

  • I tried with this in particular view controller,

Eg:

-(BOOL)prefersStatusBarHidden { return YES; }

It works well, but I cant show status bar again in the parent view controller.

20条回答
何处买醉
2楼-- · 2019-01-01 17:36

You should add this value to plist: "View controller-based status bar appearance" and set it to "NO".

查看更多
梦醉为红颜
3楼-- · 2019-01-01 17:40

You should add this value to plist: "View controller-based status bar appearance" and set it to "NO".

enter image description here

查看更多
登录 后发表回答