iOS-计算webview占用高度
2021-05-17 本文已影响0人
malgee
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
[webView evaluateJavaScript:@"document.body.offsetHeight" completionHandler:^(id _Nullable result, NSError * _Nullable error) {
CGRect frame =webView.frame;
frame.size.height =[result doubleValue];
webView.frame = frame;
}];
}