Handle touch events in ScrollView Android

后端 未结 2 2022
误落风尘
误落风尘 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 06:12

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

提交回复
热议问题