Android listview怎么实现滚动分页
package com.test;
import android.app.ListActivity;
import android.os.Bundle;
import android.os.Handler;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.LinearLayout.LayoutParams;
public class test extends ListActivity implements OnScrollListener {
Aleph0 adapter = new Aleph0();
int lastItem = 0;
int mProgressStatus = 0;
private Handler mHandler = new Handler();
ProgressBar progressBar;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LinearLayout searchLayout = new LinearLayout(this);
searchLayout.setOrientation(LinearLayout.HORIZONTAL);
progressBar = new ProgressBar(this);
progressBar.setPadding(0, 0, 15, 0);
searchLayout.addView(progressBar, new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
TextView textView = new TextView(this);
textView.setText("加载中...");
textView.setGravity(Gravity.CENTER_VERTICAL);
searchLayout.addView(textView, new LinearLayout.LayoutParams(
相关新闻>>
- 发表评论
-
- 最新评论 更多>>