How to Cancel Scrolling in UIScrollView

前端 未结 6 2001
情话喂你
情话喂你 2020-12-28 18:14

I use UIScrollView to make large-sized (larger than 320px) UI on iPhone.

I made an instance of UIScrollView and added some subviews on it. The problem is that I want

6条回答
  •  星月不相逢
    2020-12-28 18:50

    The property you're really interested in -- and I'm actually testing this out right now, because I have the same problem you do -- is canCancelContentTouches.

    If the value of this property is NO, the scroll view does not scroll regardless of finger movement once the content view starts tracking.

    If this doesn't give you the results you want, subclass UIScrollView and override the touchesShouldBegin:withEvent:inContentView method, which is what the accepted answer suggests.

提交回复
热议问题