美文网首页
iOS-计算webview占用高度

iOS-计算webview占用高度

作者: malgee | 来源:发表于2021-05-17 16:41 被阅读0次
- (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;
    }];
}

相关文章

网友评论

      本文标题:iOS-计算webview占用高度

      本文链接:https://www.haomeiwen.com/subject/lhijjltx.html