Disable 2 finger scrolling in UIScrollView

后端 未结 4 968
醉酒成梦
醉酒成梦 2021-02-02 11:44

I\'d like to disable two-finger scrolling in my UIScrollView.
I subclassed it and tweaked its built-in gesture recognizers with the following code:



        
4条回答
  •  后悔当初
    2021-02-02 12:43

    PROBLEM:

    When the UIPanGestureRecognizer is underlying a UIScrollView (which unfortunately does also effect UIPageViewController) the maximumNumberOfTouches is not behaving as expected - the minimumNumberOfTouches however always limits the lower end correctly.

    When monitoring these parameters they seem to do their job - it's just that UIScrollView doesn't honor them and ignores their values!


    REMEDY:

    You can find the solution in my answer to:

    UIScrollView scrolling only with one finger

提交回复
热议问题