Android listview怎么实现滚动分页(3)
来源:未知 责任编辑:责任编辑 发表时间:2015-09-17 09:43 点击:次
//System.out.println("lastItem:" + lastItem);
}
public void onScrollStateChanged(AbsListView v, int state) {
// if (lastItem == adapter.count
// && state == OnScrollListener.SCROLL_STATE_IDLE) {
// adapter.count += 10;
// adapter.notifyDataSetChanged();
// }
if (state == OnScrollListener.SCROLL_STATE_IDLE) {
adapter.count += 10;
adapter.notifyDataSetChanged();
}
}
class Aleph0 extends BaseAdapter {
int count = 10;
public int getCount() {
return count;
}
public Object getItem(int pos) {
return pos;
}
public long getItemId(int pos) {
return pos;
}
public View getView(int pos, View v, ViewGroup p) {
TextView view = new TextView(test.this);
view.setText("entry " + pos);
view.setHeight(90);
return view;
}
}
}
作者“ljbal”
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>