iOS UIWebView自适应实际内容高度
2020-06-08 本文已影响0人
gaookey
获取webview中scrovllview的contentsize进行设置
// MARK: - WKNavigationDelegate
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
let webViewHeight = webView.scrollView.contentSize.height
var newFrame = webView.frame
newFrame.size.height = webViewHeight
webView.frame = newFrame
}