Skip to content
New issue

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

SmoothScrollLayout 怎么给recycleView 的条目设置点击事件 #2

Open
D-zy opened this issue Oct 26, 2018 · 4 comments
Open

SmoothScrollLayout 怎么给recycleView 的条目设置点击事件 #2

D-zy opened this issue Oct 26, 2018 · 4 comments

Comments

@D-zy
Copy link

D-zy commented Oct 26, 2018

大佬,求解,,,自己怎么设置都无效~~~

@leiyun1993
Copy link
Owner

大佬,求解,,,自己怎么设置都无效~~~

他本质上就是个RecyclerView,设置点击事件就是对ItemView设置点击事件啊,然后再往外抛就好

@D-zy
Copy link
Author

D-zy commented Oct 29, 2018

接口回调设置过了,不起效果,点击事件被拦截了

@leiyun1993
Copy link
Owner

接口回调设置过了,不起效果,点击事件被拦截了

@OverRide
public boolean dispatchTouchEvent(MotionEvent ev) {
return false; //拦截事件
}
是这里拦截了,但是不拦截的话,就可以手动滑动了

@leiyun1993
Copy link
Owner

接口回调设置过了,不起效果,点击事件被拦截了

可以尝试处理onTouchEvent而非dispatchTouchEvent

@D-zy D-zy closed this as completed Nov 27, 2018
@D-zy D-zy reopened this Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants