Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIButton Doesn't allow UIScrollView to scroll

I have many UIButtons within a UIScrollView. Those UIButtons have actions attached to them in Touch Down Repeat. My problem is my scroll view doesn't scroll when I touch a button then scroll, but it works fine if I touch outside of the button.

How can I allow my scroll view to scroll even though a button is pressed?

like image 740
Matt S. Avatar asked Feb 21 '11 19:02

Matt S.


1 Answers

As long as you have the Cancellable Content Touches in Interface Builder set it should work. You can also set it in code:

scrollView.canCancelContentTouches = YES;
like image 135
Domestic Cat Avatar answered Sep 23 '22 02:09

Domestic Cat