在 iPhone 7 上使用 Xcode9 的 iOS 11
我遇到了一个问题,我可以隐藏状态栏,但是通知表仍然会拦截触摸事件,并且不会在第一次下拉时向用户显示顶部的正常“选项卡”
我正在谈论的视频
视频中使用的 View Controller 。它只是一个单页应用。
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
setNeedsStatusBarAppearanceUpdate()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override var prefersStatusBarHidden: Bool {
return true
}
}
最佳答案
此行为已在 iOS 11 中更改。所有应用程序,即使是那些隐藏状态栏的应用程序,默认情况下都将具有启动通知中心和控制中心的边缘手势。如果想要以前的行为,您可以覆盖您想要旧行为的 View Controller 的 preferredScreenEdgesForDeferring
。
有关这些更改的更多信息,请查看 What's New in Cocoa Touch WWDC 2017 session 。
关于ios - 隐藏状态栏但封面仍然拦截触摸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46689954/