We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
能不能控制左右滑动的时候就不上下滑动 上下滑动的时候就不触发左右滑动
The text was updated successfully, but these errors were encountered:
有个取巧的方法 就是设置他的高度足够大 然后外部包裹一层ScrollView 完美解决了互斥滑动 底部还能再加个--暂无更多--的标志
Sorry, something went wrong.
MatrixHelper用于控制手势滑动,GestureDetector其中监听手指滑动监听,可以在OnTableGestureListener的onScroll方法进行拦截处理
@Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { if (onInterceptListener == null || !onInterceptListener.isIntercept(e1, distanceX, distanceY)) { /** * 滚动时如果已经确认了滚动方向,就不需要再给isScrollX赋值了 */ if (!confirmScroll) { isScrollX = (Math.abs(distanceX) - Math.abs(distanceY)) > 0; confirmScroll = true; } if (isScrollX) { translateX += distanceX; } else { translateY += distanceY; } notifyViewChanged(); } return true; }
confirmScroll 和 isScrollX 可以设置为成员变量
在down时,初始化上面的变量
@Override public boolean onDown(MotionEvent e) { isFling = false; confirmScroll = false; return true; }
这样就可以解决左右上下可以同时滚动的问题
No branches or pull requests
能不能控制左右滑动的时候就不上下滑动 上下滑动的时候就不触发左右滑动
The text was updated successfully, but these errors were encountered: