伙计们请帮我解决这个问题。我只想onTouch
在listview中实现该方法来拖放文件。
我没有足够的声誉以图像形式显示错误,但错误指出Type mismatch: cannot convert from File to View
. 有没有办法转换这个?tnx 提前
View x = mCurrentNode;
x.setOnTouchListener(new AdapterView.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if(motionEvent.getAction() == MotionEvent.ACTION_DOWN){
DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
view.startDrag(null, shadowBuilder, view, 0);
view.setVisibility(View.VISIBLE);
return true;
}
return false;
}
});