在RelativeLayout 中,我想移动一个视图。但是在 onTouch() 只有 ACTION_DOWN 被击中。我无法获得 ACTION_MOVE 或 ACTION_UP。下面是代码片段。
private final class MyTouchListener implements OnTouchListener {
public boolean onTouch(View view, MotionEvent motionEvent) {
switch (motionEvent.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
log("onTouch motion event ACTION_DOWN ");
break;
case MotionEvent.ACTION_MOVE:
log("onTouch motion event ACTION_MOVE ");
break;
case MotionEvent.ACTION_UP:
log("onTouch motion event ACTION_UP ");
break;
}
return true;
}
}
需要帮忙....