WKWebView
2017-10-21 本文已影响17人
UorDaer
- (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];
}