Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 隐藏状态栏,但封面页仍会拦截触摸_Ios_Swift - Fatal编程技术网

Ios 隐藏状态栏,但封面页仍会拦截触摸

Ios 隐藏状态栏,但封面页仍会拦截触摸,ios,swift,Ios,Swift,在iOS 11上,在iPhone 7上使用Xcode9 我有一个问题,我可以隐藏状态栏,但是通知单仍然会拦截触摸事件,并且不会在第一次下拉时向用户显示顶部的正常“选项卡” 我正在谈论的视频 查看视频中使用的控制器。它只是一个单页应用程序 class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any addition

在iOS 11上,在iPhone 7上使用Xcode9

我有一个问题,我可以隐藏状态栏,但是通知单仍然会拦截触摸事件,并且不会在第一次下拉时向用户显示顶部的正常“选项卡”

我正在谈论的视频

查看视频中使用的控制器。它只是一个单页应用程序

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改变了这种行为。所有应用程序,即使是那些隐藏状态栏的应用程序,默认情况下都会有启动通知中心和控制中心的边缘手势。如果您想要上一个行为,您可以覆盖视图控制器的
PreferredScreeneedgesfordeferring
,该视图控制器需要旧的行为


有关这些更改的更多信息,请查看WWDC 2017会议。

我想,他正在将状态栏设置为lightcontent。在viewDidLoad方法或ViewWillAspect方法中类似这样的内容:
UIApplication.shared.setStatusBarStyle(UIStatusBarStyle.lightContent,动画:true)
No状态栏实际上与
view.backgroundColor=UIColor.blue一起消失了。你认为我应该更新youtube视频以显示这一点吗?关键是它的空白应用程序XXCODE给你的单页应用程序只添加PaseStasuBARWORD,这在所有的应用程序中都有相同的效果。