views:

135

answers:

1

I have a UIScrollView to which I add a bunch of UIImageView's as sub views. Everything works fine apart from that I get input from the subviews when they are outwith the visible area of the scroll view. I would have thought the scroll view would prevent any events from reaching subviews outwith the visible area by default but I presume this isn't the case?

In which case I assume I have to use the content offset, subview positions etc. to calculate whether to prevent the input myself?

A: 

UImageView user interaction is not enabled as a default, so you probably enabled it somewhere. You could do a check on the scrollview delegate to see if that imageview is in front by a tag, and if it is not visible disable it.

David Sowsy
The ImageView's are all added as subviews of the ScrollView so I imagine will always be in front will they not? Or is it the standard behaviour of the scroll view to move one its subviews behind itself when it scrolls out of the display area? If so what happens when a view is half in and half out of the viewable area, will it still accept input in the portion which is out of the area?
ShawnLane