WKWebView

- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {

//动态设置高度

[webView evaluateJavaScript:@"document.body.offsetHeight" completionHandler:^(id _Nullable result, NSError * _Nullable error) {

webView.height = [result doubleValue];

CGRect frame = webView.frame;

frame.size.height = webView.height;

webView.frame = frame;

}];

//设置字体大小

[webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '300%'" completionHandler:nil];

}

你可能感兴趣的:(WKWebView)