在带有导航栏的ViewController.swfit中增加WKWebView来显示网页,处理不当会导致WKWebView的Y坐标位置下移64,解决方法是在viewDidLoad中增加
self.automaticallyAdjustsScrollViewInsets = false。
此属性的官方解释如下:
A Boolean value that indicates whether the view controller should automatically adjust its scroll view insets.
实例代码如下: