80,362
社区成员
发帖
与我相关
我的任务
分享
public class ImageAdater extends BaseAdapter{
private Context myContext;
private String[] a = {"1","2"};
private Button the_ballView;
public ImageAdater(Context myContext)
{
this.myContext = myContext;;
}
public int getCount() {
// TODO Auto-generated method stub
return a.length;
}
public Object getItem(int position) {
// TODO Auto-generated method stub
return position;
}
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
the_ballView = new Button(myContext);
the_ballView.setBackgroundResource(R.drawable.ball3);
the_ballView.setText(a[position]);
the_ballView.setWidth(30);
the_ballView.setHeight(30);
return the_ballView;
}
}