huxq17 / XRefreshView

一个万能的android下拉上拉刷新的框架,完美支持recyclerview
1.7k stars 501 forks source link

在三星c5、小米5等机型在webview上加XRefreshView,会出现加载更多没有效果现象。 #72

Closed hoohom closed 7 years ago

xianzhi33 commented 7 years ago

这是正常的吧 webview不是NestedScrollingChild

hoohom commented 7 years ago

WebView webview = (WebView) child; return canScrollVertically(child, 1) || webview.getContentHeight() * webview.getScale() != webview.getHeight() + webview.getScrollY(); 有的机型计算会出现偏差

huxq17 commented 7 years ago

@hoohom 这个可以自己计算什么时候到达底部,xrefreshview提供了setOnBottomLoadMoreTime方法,具体用法如下: ` refreshView.setOnBottomLoadMoreTime(new OnBottomLoadMoreTime() {

        @Override
        public boolean isBottom() {
            if (stickyLv.getLastVisiblePosition() == mTotalItemCount - 1) {
                View lastChild = stickyLv.getListChildAt(stickyLv.getListChildCount() - 1);
                return (lastChild.getBottom() + stickyLv.getPaddingBottom()) <= stickyLv.getMeasuredHeight();
            }
            //没有到达底部则返回false
            return false;
        }
    });`

demo里的CustomViewActivity中有此代码。

huxq17 commented 7 years ago

@hoohom 用XWebView,已经解决了这个问题。