如图:
1、如果listview中items超过一屏;
2、点击第一个checkbox,该checkbox选中,然后滑动listview到最后一条数据;
3、再返回到第一条数据时,选中的checkbox未选中。而是其他某一个checkbox选中;
   求大侠。。

解决方案 »

  1.   

    自己顶下: 注意是listview中数据超过1屏的时候
      

  2.   

    遇到过这样的问题,scroll的时候乱七八糟的。当时好像替换掉checkbox了。不用那控件的。大概思路是 每一个item对应一个bean,每个bean有check这个属性
    check属性有为true/false的值.
    check选项为true时一个drawable.false时另一个drawable.
      

  3.   

    组件重用问题。
    首先弄个选中商品的List,勾选时把商品id什么的add进去。
    在adapter的getView方法里加个判断。
    if(list.contains(id)){
      checkBox.setChecked(true);
    } else {
      checkBox.setChecked(false);
    }
      

  4.   

    参考 这个 定义一个布尔数组专门对应每一个checkbox默认都设为false,每次点击的时候
    http://blog.csdn.net/gyflyx/article/details/6567916
      public View getView(int position, View convertView, ViewGroup parent) {    
           // TODO Auto-generated method stub    
           Log.e("method", "getView");    
           final int selectID = position; 
           boolean bool;
           if(listItems.get(position).get("ck") == "0"){
            bool = false;
           }else{
            bool = true;
           }
           .........
    bHolder.buttonClose.setOnClickListener(new lvButtonListener(position));  
                }          
                return convertView;  
            }  
            class lvButtonListener implements OnClickListener {  
                private int position;  
                lvButtonListener(int pos) {  
                    position = pos;  
                }  
                  
                @Override  
                if(v.getId() == listItemView.check.getId()){
    hasChecked[pos] = !hasChecked[pos];
    if(hasChecked[pos]){
    //listItems.get(pos).put("info", "FUCk");
    listItems.get(pos).put("ck", "1");
    }else{
    //listItems.get(pos).put("info", "YOU");
    listItems.get(pos).put("ck", "0");
    }
    notifyDataSetChanged();
    }