The Question

Does anyone know of technical reasons for avoiding web views inside scroll views on iOS (assuming you're willing to disable scrolling inside the web views themselves)?

If you look at the Apple docs for UIWebView, they state:

Important: You should not embed UIWebView or UITableView objects in UIScrollView objects. If you do so, unexpected behavior can result because touch events for the two objects can be mixed up and wrongly handled.

My Educated Guess

It looks like maybe they're warning you against putting a scroll view inside another scroll view, because touches can be confused between the inner, and outer scroll views.

But, there's a very valid reason to want to put a UIWebView inside a scroll view. Web views aren't just scroll views. UIWebView can easily display a wide range of web content.

If there is no need to allow scrolling within the UIWebView itself, and you turn off scrolling with either:

webView.userInteractionEnabled = NO;

or

webView.scrollView.scrollEnabled = NO;

then is there really any problem with this design?

I'm wondering if this is partly an artifact of the original UIWebView interface, where it did not give you direct (and documented) access to its embedded UIScrollView (to be able to disable its scrolling easily). Maybe t

Edit
Report