不能隐藏状态栏
不能隐藏状态栏。在带有眉毛的iPhone上可以吗?
在viewController中:
...
override var prefersStatusBarHidden: Bool {
return true
}
...
override func viewDidLoad() {
super.viewDidLoad()
print(prefersStatusBarHidden) // true
}
...
Cant hide status bar. Is it possible on iPhones with an eyebrow?
In ViewController:
...
override var prefersStatusBarHidden: Bool {
return true
}
...
override func viewDidLoad() {
super.viewDidLoad()
print(prefersStatusBarHidden) // true
}
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
方法1:转到您的info.plist文件。
添加一个称为“基于查看控制器的状态栏外观”的密钥,并将其值设置为NO。
方法2:转到您的应用程序委托并编写此类代码行。
例子:
Method 1: Go to Your info.plist file.
Add a key called “View controller-based status bar appearance” and set its value to NO.
Method 2: Go to your app delegate and write this line of code.
Example:
在.plist中添加基于控制器的状态栏外观,并将其设置为是。
Add View controller-based status bar appearance in .plist and set it to YES.