IOS7以下的版本中隐藏状态栏十分方便:
[[UIApplication sharedApplication] setStatusBarHidden:YES];
只要这么一句就解决问题了,但在IOS7中就不是这样了。有人说写代码,有人说info.plist里加一行即OK
说写代码的人是这样的:
‐ (BOOL)prefersStatusBarHidden {
return YES;
}
我试了好象无效
说改info.plist的人是这样的:
说改info.plist的人是这样的:
You should add this value to plist: "View controllerbased status bar appearance" and set it to "NO". This would let you set the status bar to hidden mode and it's global not like other answers.
UPDATE: If you want that the status bar would be hidden on splash screen don't forget to mark "Hide during application launch" on target status bar options. Also, you can add "Status bar is initially hidden" to "YES" on the plist if you don't want to do it with code inside the app.
试了之后。立马见效。
原文来自:http://stackoverflow.com/questions/17763719/status-bar-wont-disappear