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

先赞一个控件,然后发现了个小BUG。关于下拉刷新的 #2

Open
nonsense0biubiu opened this issue Jan 18, 2018 · 2 comments

Comments

@nonsense0biubiu
Copy link

nonsense0biubiu commented Jan 18, 2018

如果scrollview 里的内容为空或者子view的个数不足以向下滑动的时候。
无法下拉刷新。
暂时个人的解决办法:
if (!canChildScrollDown()) {//若是底部不能滑动,则yDiff是负值,取反后与mTouchSlop做比较。 if (yDiff < 0) { yDiff = -yDiff; } }
这里。对yDiff做一个判负。就可以解决了。期待更新~~~
上面的方法不对。 sorry 。高兴的太早了。会导致向上滑的时候引起refresh动作
下面的方法才对。我测试过程中。没什么问题。
if(!canChildScrollDown()){//若是底部不能滑动,则yDiff是负值,取反后与mTouchSlop做比较。

                if (yDiff < 0 || canChildScrollUp()) {
                    yDiff = -yDiff;
                }
            }

这里加上一个判断。 这样就好了

@Ming-XF
Copy link

Ming-XF commented Mar 18, 2022

谢谢哥,你是我大恩人!!!!!

@wqbs369
Copy link

wqbs369 commented Apr 28, 2023

这个是正解,我搞了半天都好不了,还好楼主666

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

3 participants