Jump to content

Adding UIWebView as child of UIView doesn't work when there is more than 1 view


2 posts in this topic

Recommended Posts

I am trying to create multiple UIView subclasses (4 to be exact) on my main window, each of which will display a different UIWebView (there is one web view child per UIView instance). I have everything setup and hooked up in the nib and in the code, but for some reason only the first web view actually shows up. I've even tried giving each of the four UIViews different background colors so I could see where they start and end; everything looks fine (except of course that the web views aren't rendering for views 2-4 at all).


I've posted the code for my custom view (called CameraWebView) here: http://pastebin.com/m62950fea


I know for sure that all the web views are being properly allocated and initialized and that they are each being sent the proper HTML to load from elsewhere in the app. But again, only the first one is actually displaying the web content.


This works fine when everything is simply a UIWebView and there is no UIView container class. However UIWebView eats touch events so I can't do any drag-and-drop or double-tap-detection of the view to do special things with it.


I've been struggling with this for almost a week now and I'd really appreciate any help anyone could offer.


Link to comment
Share on other sites


  • Create New...