cr: http://www.programering.com/a/MjNwATMwATQ.html
public class VerticalScrollView extends ScrollView { private GestureDetector mGestureDetector; public VerticalScrollView(Context context, AttributeSet attrs) { super(context, attrs); mGestureDetector = new GestureDetector(context, new YScrollDetector()); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { return super.onInterceptTouchEvent(ev) && mGestureDetector.onTouchEvent(ev); } class YScrollDetector extends SimpleOnGestureListener { @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { /** * If we rolling closer to the horizontal direction, return false, let the child to handle it */ return (Math.abs(distanceY) > Math.abs(distanceX)); } } }