Handle touch events in ScrollView Android

后端 未结 2 2012
误落风尘
误落风尘 2021-02-14 05:41

I would like to implement drag-n-drop feature for Android 2.2. I override onTouchListener for each my control. But all my controls are inside ScrollView. When all my controls ar

相关标签:
2条回答
  • 2021-02-14 05:49

    Have a look at the onInterceptTouchEvent() method. You'll have to sub-class ScrollView and override and tweak this method.

    0 讨论(0)
  • 2021-02-14 06:12

    Use mScrollView.requestDisallowInterceptTouchEvent(true); to avoid ScrollView to handle touchEvents. Also as Ridcully pointed out handle the touch event in onInterceptTouchEvent().

    0 讨论(0)
提交回复
热议问题