简体   繁体   中英

Edit PullToRefresh listview to refresh from bottom

Here's Erik Wallentinsen's PullToRefresh ListView on github.

But it refreshes the listview from top only:

屏幕截图

I want to change this, and refresh the listview when it gets pulled from bottom.

Apparently, it is needed to change this source .

Maybe somebody already had this issue and solved it?

I recommend you use chrisbanes 's library: https://github.com/chrisbanes/Android-PullToRefresh which supports listview, gridview, scrollview, webview ... Here is an start guide
To refresh listview from bottom, just set mode for it. Here is an example that I tried:

PullToRefreshListView mPullRefreshListView = 
  (PullToRefreshListView) findViewById(R.id.listview);
mPullRefreshListView.setMode(Mode.BOTH);    // mode refresh for top and bottom
mPullRefreshListView.setShowIndicator(false); //disable indicator
mPullRefreshListView.setPullLabel("Loading");

 mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
            public void onRefresh(PullToRefreshBase<ListView> refreshView) {
          //do something when refresh
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM