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

如果解决滑动模式下添加自定义布局设置view点击事件的问题? #81

Open
Android-xiaole opened this issue Sep 20, 2019 · 3 comments

Comments

@Android-xiaole
Copy link

如题,类似在章节末尾增加按钮,并可以设置点击事件,但是滑动模式下如果准确获取自定义布局的坐标呢?

@Android-xiaole
Copy link
Author

我是将自定义布局的view转换成bitmap画到画布上的,但我始终只能得到一个初始坐标,滑动的时候无法准备获取anim执行之后的坐标,这样就无法设置点击事件了

@rainmeterLotus
Copy link

使用RectF,将你的Bitmap绘制在RectF区域内,然后,上下滚动的时候,能收到上下滚动的距离,然后再给RectF做上下距离的变换:
public RectF(float left, float top, float right, float bottom) {
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}

@Android-xiaole
Copy link
Author

good idea

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