onInterceptTouchEvent, onTouchEvent only see ACTION_DOWN

后端 未结 4 1211
春和景丽
春和景丽 2021-01-18 11:56

I have a top level ViewGroup, which I call SliderView, in which I want to detect swiping. This is mostly working, but one weird failure persists.

The essence of Sli

4条回答
  •  误落风尘
    2021-01-18 12:13

    From Android developer's reference (http://developer.android.com/reference/android/view/ViewGroup.html#onInterceptTouchEvent(android.view.MotionEvent)):

    "2. .... Also, by returning true from onTouchEvent(), you will not receive any following events in onInterceptTouchEvent() and all touch processing must happen in onTouchEvent() like normal."

    Maybe because your onTouchEvent always returns true..?

提交回复
热议问题