获取webView的高度:
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
NSString *heightStr = [webView stringByEvaluatingJavaScriptFromString:@"document.body.scrollHeight;"];
double height = heightStr.doubleValue;
NSLog(@"hhh %.2f",height);
}
获取webView的高度:
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
NSString *heightStr = [webView stringByEvaluatingJavaScriptFromString:@"document.body.scrollHeight;"];
double height = heightStr.doubleValue;
NSLog(@"hhh %.2f",height);
}