在我的项目中,我可以在iPhone上隐藏状态栏。
但它对我的iPad不起作用如何在iPad上隐藏状态栏?
答案 0 :(得分:3)
you should override the method,
-(BOOL)prefersStatusBarHidden{
return YES;
}
in every viewcontroller
if you have not making setting in info.plist
for hiding it.
if you want to manage in info.plist
then,
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
You can check the screenshot below
screenshot reference : this so answer, you can refer this post also btw.
答案 1 :(得分:0)
我有同样的问题,我已经用查理·菲什(Charlie Fish)显示的内容设置了info.plist,但这没有帮助。
我通过将TARGETS-> Deployment info-> Devices更改为iPad,然后运行Xcode来解决。
答案 2 :(得分:0)
目标C:
- (BOOL)prefersStatusBarHidden{
return YES;
}
迅速4:
override var prefersStatusBarHidden: Bool {
return true
}