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

配合X5WebView使用不行 #2

Closed
ypf168326 opened this issue Jun 13, 2017 · 3 comments
Closed

配合X5WebView使用不行 #2

ypf168326 opened this issue Jun 13, 2017 · 3 comments

Comments

@ypf168326
Copy link

本人使用的不是系统默认的webview,是腾讯tbs的webview,发现在页面上拉浏览下面的页面,在返回到顶部的时候,直接触发了下拉刷新(此时还停留在页面中间),是不是你的控件高度判断有问题?

@823546371
Copy link
Owner

自己定义一个类重写canScrollVertically方法

@Override
    public boolean canScrollVertically(int direction) {
        final int offset = getWebScrollY();
        final int range = computeVerticalScrollRange() - computeVerticalScrollExtent();
        if (range == 0) return false;
        if (direction < 0) {
            return offset > 0;
        } else {
            return offset < range - 1;
        }
    }

一会我会上传新的版本,里面有例子

@ypf168326
Copy link
Author

ypf168326 commented Jun 13, 2017 via email

@ypf168326
Copy link
Author

@823546371 经测试,确实可行,谢谢兄弟。

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