如何应用下拉ListView的效果并释放它,它会刷新。 与Facebook相同,当它下拉时,它将刷新NewsFeeds。
答案 0 :(得分:2)
答案 1 :(得分:2)
您可以使用this在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();
}
});