【发布时间】:2016-12-13 04:20:25
【问题描述】:
我正在使用OnDragListener 拖放图像。我有MOTIONEVENT.ACTION_MOVE 来实现图像移动功能。在动作移动的某个时刻,我想结束拖动并移除它的阴影。是否可以在拖动事件中设置动作?在释放手指之前,我想调用 drop 事件。
switch(event.getAction()) {
case MotionEvent.ACTION_MOVE:
//here i want to remove shadow and stop dragging
break;
case DragEvent.ACTION_DROP:break;
}
【问题讨论】:
-
您使用的是 Listview 还是 Recyclerview?
-
在运行时相应地改变背景。
标签: android drag-and-drop touch motionevent