问题
I'm basically trying to disable the scroll on List View. Which can be done by
@Override
public boolean dispatchTouchEvent(MotionEvent ev){
if(ev.getAction()==MotionEvent.ACTION_MOVE){
ev.setAction(MotionEvent.ACTION_CANCEL);
}
super.dispatchTouchEvent(ev);
return true;
}
But I do not want to create a custom List View (widget) class for this.
Is there any way I could do it like myListView.dispatchTouchEvent(ev)
???
Thanks in advance.
回答1:
Give this a try:
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
return true;
}
来源:https://stackoverflow.com/questions/11401164/set-dispatchtouchevent-for-list-view-without-creating-custom-list-view-class-f