Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITapGestureRecognizer is overriding UIButton actions on Scrollview

I have a Scrollview with a button on it. I have an action set to TouchupInside. Works fine initially. So I need the Scrollview will autohide if it hasnt been touched in 3 seconds. To accomplish this i am using UITapGestureRecognizer on the Scrollview. It definitely works if you touch anywhere in the Scrollview. Unfortunately the UIButton no longer works. The UITapGestureRecognizer seems to supersede the button.

Any ideas how to get the UIButton Action to work?

like image 952
Abbacore Avatar asked Jul 20 '10 22:07

Abbacore


1 Answers

You can stop the UITapGestureRecognizer from cancelling other events using this line:

tapRecognizer.cancelsTouchesInView = NO;

Worked for me :)

like image 165
jowie Avatar answered Oct 14 '22 17:10

jowie