解决方案:
方法1:在html中设置
<meta name="viewport" content="viewport-fit=cover,maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
方法2:oc代码解决
if #available(iOS11.0, *) { self.webview.scrollView.contentInsetAdjustmentBehavior= .never; }