我在ListView
. 当我单击任何复选框时,屏幕外的几个复选框会被一起选中。几行后,复选框似乎引用了顶部复选框。
if(convertView == null) {
holder = new Holder();
LayoutInflater inflater=((Activity)context).getLayoutInflater();
convertView = inflater.inflate(R.layout.row, null);
holder.image = (ImageView) convertView.findViewById(R.id.t1);
holder.textview = (TextView) convertView.findViewById(R.id.t2);
holder.check = (CheckBox) convertView.findViewById(R.id.t3);
holder.image.setImageBitmap(null);
convertView.setTag(holder);
} else {
holder = (Holder) convertView.getTag();
holder.check.setChecked(false);
}
holder.check.setTag(position);