WKWebKit查看重叠iOS 10上的状态栏,但不是iOS 11

时间:2018-03-12 16:07:46

标签: ios swift wkwebview

我正在以编程方式使用此代码创建Web视图

var webView: WKWebView!

override func loadView() {
    let webConfiguration = WKWebViewConfiguration()
    webView = WKWebView(frame: .zero, configuration: webConfiguration)
    webView.uiDelegate = self
    view = webView
}

在iOS 11上,Web视图顶部位于状态栏的底部,但在iOS 10上,Web视图覆盖整个屏幕,包括顶部的时钟,电池等。

我尝试在检查器中对视图控制器进行调整,但似乎没有任何影响。

有没有办法阻止网页视图填满整个屏幕?

2 个答案:

答案 0 :(得分:0)

我实际上没有解决问题,但已添加:

library/                  # Put the custom modules files here
filter_plugins/           
roles/
       library/           # or here

作为合适的解决方法。

答案 1 :(得分:0)

这应该可行:

(today, sun, mon, tue, wed, thu, fri, sat) = get_dates()