4

如何应用下拉 ListView 并释放它的效果,它会刷新。和 Facebook 一样,拉下它时,它会刷新 NewsFeeds。

4

1 回答 1

2

您可以使用在 android 中创建此类列表。

您必须在代码中使用刷新侦听器:

   PullToRefreshListView listView = (PullToRefreshListView) findViewById(R.id.pull_to_refresh_listview);
   listView.setOnRefreshListener(new OnRefreshListener() {


public void onRefresh() {
    // Your code to refresh the list contents

    // ...

    // Make sure you call listView.onRefreshComplete()
    // when the loading is done. This can be done from here or any
    // other place, like on a broadcast receive from your loading
    // service or the onPostExecute of your AsyncTask.

    listView.onRefreshComplete();
}
});
于 2012-10-19T12:21:12.423 回答