我正在尝试创建一个自定义的相册来禁用滚动。我从这里得到了以下内容:如何禁用相册视图滚动
public class MyGallery extends Gallery{
public MyGallery(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY){
if (isSelected())
return true;
else return super.onFling(e1, e2, velocityX, velocityY);
}
}
看起来好像不起作用。我做错了什么吗?