R – iPhone – strange issue with UIScrollView and touches

iphoneuiscrollview

I have two UIImageView objects inside my view (both 320×480 one above the other). The lower image view is inside a UIScrollView with scrolling and zooming enabled. Now I want to handle touches inside the other image view but it no longer detects any single taps.

I can understand that the UIScrollView handles all the touches which I do on it. But the touches on the image view above the scroll view are also not recognized.

Attached is an image with my view hierarchy. Can someone please tell me why the other image view's touches are also handled by the scrollview when it isn't a subview of scroll view?

And if the scrollview is bent on handling touches, how do I recognize touches on the other image view?

Thanks.
alt text

Best Answer

By default UIImageViews have userInteractionEnabled=NO;

Try setting it to YES (either in IB or in code).

Related Topic