I need to be able to resize the height of a UIWebView until all the content is visible.
Is this possible?
After you have loaded content in the UIWebView
you can use it's stringByEvaluatingJavaScriptFromString:
method to ask the html document for its height. This is a little tricky but should work.
You can do something like this:
NSInteger height = [[webView stringByEvaluatingJavaScriptFromString:
@"document.body.scrollHeight"] integerValue];
The scrollheight mught not be the best. You have a couple of options. Experiment with the document properties mentioned in http://james.padolsey.com/javascript/get-document-height-cross-browser/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With