iOS11 WKWebview获取高度不准确问题

遇见这个问题的时候,我发现偏离了大概64像素,由此联想到了tableView和collectionView。

故解决办法如下:

if (@available(iOS 11.0, *)) {

        _webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;

        _webView.scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);

        _webView.scrollView.scrollIndicatorInsets = _webView.scrollView.contentInset;

    }


猜你喜欢

转载自blog.csdn.net/zhaotao0617/article/details/78274806