如何禁止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 }



posted on 2012-03-20 16:20  小猪笨  阅读(770)  评论(0)    收藏  举报

导航