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

viewpager+fragment ,只用下拉刷新功能没问题,把上拉加载功能加上 就不能展示全部数据了 #334

Open
playmans opened this issue Apr 23, 2018 · 1 comment

Comments

@playmans
Copy link

viewpage+fragment,fragment 中有listview, 如果有10条数据需要展示。 在只是下拉刷新的时候可以正常显示数据。 如果加上了上拉加载,就能展示一个屏幕的数据。 其他的都不展示了。

private void refersh() {
mPtrFrame.disableWhenHorizontalMove(true);
mPtrFrame.setPtrHandler(new PtrDefaultHandler2() {

        @Override
        public boolean checkCanDoLoadMore(PtrFrameLayout frame, View content, View footer) {
            return mPagerAdapter.checkCanDoLoadMore();
        }

        @Override
        public void onLoadMoreBegin(PtrFrameLayout frame) {
          
            mPagerAdapter.updateData(mFragmentViewPager.getCurrentItem());
        }

        @Override
        public boolean checkCanDoRefresh(PtrFrameLayout frame, View content, View header) {
            return mPagerAdapter.checkCanDoRefresh();
        }

        @Override
        public void onRefreshBegin(PtrFrameLayout frame) {
            mPagerAdapter.updateData();
        }
    });
}
@GHpeter
Copy link

GHpeter commented May 2, 2018

大兄弟你解决了吗?我现在也遇到了这个问题,请教下

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