0
votes

I have a UIScrollview to allow for pagination, and a UIWebview on the detail views inside. I know you are not supposed to do that according to Apples Class Reference, but I don't see another option.

In order to make responses and experience a bit better, I disabled scrolling of the Webview, with:

[[[webView subviews] lastObject] setScrollEnabled:FALSE];

But now I am looking for a solution to make the webview the right size, depending on the content. Is there an easy way to do this, where the width of the webview stays the same, but the height grows (automatically) when that is required to show the full article? This will remove the scrolling problem, as it sit he scrollview who will take care of all the scrolling in this scenario.

Does that make sense?

1

1 Answers

0
votes

Sure - this isn't that uncommon a scenario (needing to figure out the entire height of a UIWebView so you can size it's frame to avoid the web view itself scrolling, such as when a web view is in a table view, or parent scroll view).

You should refer to this answer: How to determine UIWebView height based on content, within a variable height UITableView?

Which will basically answer your question. You create your scroll view, load in the content, run some javascript to get the full height, and then adjust the web view frame to reflect the full height of the content.