我将一个ontouch监听器附加到我的listview,这样我就可以从左到右拖动列表视图。虽然我拖动列表视图也可以滚动它。如何在拖动时禁用列表视图滚动。
答案 0 :(得分:1)
listView.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_MOVE) {
return true; // Indicates that this has been handled by you and will not be forwarded further.
}
return false;
}
});
或强>
listView.setScrollContainer(false);