我有一个ImageView监听我的触摸事件。在ACTION_DOWN情况下,我正在拖拽图像。我能够拖动它,但无法检测到移动事件,因为该事件从未被调用。
card.setOnTouchListener(this); // inside onCreate()
public boolean onTouch(View view, MotionEvent motionEvent) {
switch (motionEvent.getAction()) {
case (MotionEvent.ACTION_DOWN):
DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
view.startDrag(null, shadowBuilder, view, 0);
view.setVisibility(View.INVISIBLE);
return true;
case (MotionEvent.ACTION_MOVE):
Log.v("pref", "sometimes");
return true;
}
return true;
}