如何禁止Gridview滑动
继承GridView,并重写dispatchTouchEvent()方法。
1 @Override
2 public boolean dispatchTouchEvent(MotionEvent ev) {
3 if (ev.getAction() == MotionEvent.ACTION_MOVE) {
4 return true;
5 }
6 return super.dispatchTouchEvent(ev);
7 }
继承GridView,并重写dispatchTouchEvent()方法。
1 @Override
2 public boolean dispatchTouchEvent(MotionEvent ev) {
3 if (ev.getAction() == MotionEvent.ACTION_MOVE) {
4 return true;
5 }
6 return super.dispatchTouchEvent(ev);
7 }