取到WebView的高度

- (void)webViewDidFinishLoad:(UIWebView *)webView  {
    CGFloat height = [[webViewstringByEvaluatingJavaScriptFromString:@"document.body.offsetHeight"] floatValue];
    CGRect frame = webView.frame;
    webView.frame = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, height);
}

你可能感兴趣的:(取到WebView的高度)