<分区>
我需要获取 UIWebView 的高度。在方法 webViewDidFinishLoad 中我有
CGFloat height1 = [[webView stringByEvaluatingJavaScriptFromString: @"document.body.scrollHeight"] floatValue];
CGFloat height2 = [[webView stringByEvaluatingJavaScriptFromString: @"document.body.offsetHeight"] floatValue];
CGFloat height3 = [[webView stringByEvaluatingJavaScriptFromString: @"document.body.clientHeight"] floatValue];
CGFloat height4 = [[webView stringByEvaluatingJavaScriptFromString: @"document.documentElement.clientHeight"] floatValue];
CGFloat height5 = [[webView stringByEvaluatingJavaScriptFromString: @"document.documentElement.scrollHeight"] floatValue];
CGFloat height6 = [[webView stringByEvaluatingJavaScriptFromString: @"document.documentElement.offsetHeight"] floatValue];
height = MAX(height1, MAX(height2, MAX(height3, MAX(height4, MAX(height5, height6)))));
而且仍然所有的值都小于实际值 我只在 iOS 10 有这个问题