禁用安全区域布局指南

时间:2019-03-18 06:58:58

标签: ios swift autolayout

从图像中可以看到,我想从代码中禁用安全区域布局指南“红色区域”,因为从代码中构建我的UI不会使故事变得无聊,因此我的视图可以覆盖整个屏幕
enter image description here

 let webConfiguration = WKWebViewConfiguration()
        webConfiguration.userContentController.add(self, name: "webpage")
        self.webpage = WKWebView(frame: .zero, configuration: webConfiguration)
        self.webpage.navigationDelegate = self
        self.webpage.uiDelegate = self
        self.webpage.isOpaque = false
        self.webpage.scrollView.isScrollEnabled = false
        self.webpage.backgroundColor = UIColor.clear
        self.webpage.scrollView.backgroundColor = UIColor.clear
        view = webpage

1 个答案:

答案 0 :(得分:0)

您可以像这样覆盖属性-

override var safeAreaLayoutGuide: UILayoutGuide {
    return UILayoutGuide()
}