if(action == MotionEvent.ACTION_UP){
//this.getScrollX()得到的是 偏移量
if(this.getScrollX() > (mMenuWidth / 2)) ?
{
this.smoothScrollTo(mMenuWidth, 0);
}else{
this.smoothScrollTo(0, 0);
}
return true;
}
如果不寫 return true ,放開手指,屏幕不會(huì)自動(dòng)進(jìn)行縮放,這是為什么
2014-10-29
smoothScrollTo本質(zhì)上是由mScroller實(shí)現(xiàn)的效果,可能super.onTouchEvent在UP中做了一些操作,影響了smoothScrollTo。