I have a bunch of UIButton
s within a UIView
within a UIScrollView
. I'm trying to add a tap recognizer to the scroll view. The tap recognizer fires, but now none of my buttons work.
I know that in iOS5, UIScrollView
can somehow pass a touch event down to the control hierarchy after being done with it. Anyone can help me figure out how to do this?
You could also use the
gestureRecognizer:shouldReceiveTouch:
method of theUIGestureRecognizerDelegate
, which is documented here, to accomplish the same thing. It offers a little more flexibility, for instance, if you want to cancel certain touches, but not others. Here's an example,Set the
UIGestureRecognizer
propertycancelsTouchesInView
to NO.From UIGestureRecognizer Class Reference
For me a combo of the above answers worked
-