lcodecorex / TwinklingRefreshLayout

RefreshLayout that support for OverScroll and better than iOS. 支持下拉刷新和上拉加载的RefreshLayout,自带越界回弹效果,支持RecyclerView,AbsListView,ScrollView,WebView
Apache License 2.0
4k stars 672 forks source link

禁止底部刷新后,上拉时还会显示loading一会 #10

Closed guoyoujin closed 7 years ago

guoyoujin commented 7 years ago

调用代码,禁止底部刷新后,上拉时还会显示loading一会,不知是否发现

        refreshLayout.setEnableLoadmore(false);

发现了问题所在,解决办法是:

/**
     * 设置底部View
     */
    public void setBottomView(final IBottomView bottomView) {
        if (bottomView != null) {
            post(new Runnable() {
                @Override
                public void run() {
                    mBottomLayout.removeAllViewsInLayout();
                    mBottomLayout.addView(bottomView.getView());
                }
            });
            mBottomView = bottomView;
            if (mBottomView != null) {
                if (enableLoadmore) mBottomView.getView().setVisibility(VISIBLE);
                else mBottomView.getView().setVisibility(GONE);
            }
        }
    }