Android listview怎么实现滚动分页(2)
来源:未知 责任编辑:责任编辑 发表时间:2015-09-17 09:43 点击:次
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.FILL_PARENT));
searchLayout.setGravity(Gravity.CENTER);
LinearLayout loadingLayout = new LinearLayout(this);
loadingLayout.addView(searchLayout, new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
loadingLayout.setGravity(Gravity.CENTER);
getListView().addFooterView(loadingLayout);
// Start lengthy operation in a background thread
// new Thread(new Runnable() {
// public void run() {
// while (mProgressStatus < 100) {
//
// // Update the progress bar
// mHandler.post(new Runnable() {
// public void run() {
// progressBar.setProgress(mProgressStatus);
// }
// });
// }
// }
// }).start();
registerForContextMenu(getListView());
setListAdapter(adapter);
getListView().setOnScrollListener(this);
}
public void onScroll(AbsListView v, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
//lastItem = firstVisibleItem + visibleItemCount - 1;
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>