I have a UIWebView where I load HTML content (stylised using CSS). I wish to set the correct frame (specifically height) for the webView in the webViewDidFinishLoad method. I'm going nuts. Is there no standard/uniform way to figure out the HTML content's height?
Specifically the height required resides within a div named "ABC". The closest to the correct height is:
[webView stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"ABC\").offsetHeight;"].intValue)]
I've tried clientHeight and scrollHeight for the above. I've also tried document.body.client/scroll/offsetHeight. None of the above give me a perfect height value. Everything results in some part of the webview getting cut off as the resultant height is lesser than the required value. How do you solve this thing?