Listview SimpleCrsorAdapter bindView在列表中随机显示图像

Listview SimpleCrsorAdapter bindView在列表中随机显示图像,listview,view,simplecursoradapter,Listview,View,Simplecursoradapter,BindView标记随机线。我尝试检查数据的值,if语句工作正常。我所要做的就是当数据库中的完成字母class='T'时显示(设置为可见)图像。那么,为什么要标记随机线呢 dataAdapter = new SimpleCursorAdapter( this, R.layout.component_details, null, columns, to, 0){

BindView标记随机线。我尝试检查数据的值,if语句工作正常。我所要做的就是当数据库中的完成字母class='T'时显示(设置为可见)图像。那么,为什么要标记随机线呢

dataAdapter = new SimpleCursorAdapter(
        this, 
        R.layout.component_details, 
        null, 
        columns, 
        to, 
        0){                         
            @Override
            public void bindView(View view, Context context, Cursor cursor) {                   
                super.bindView(view, context, cursor);
                View completed = findViewById(R.id.txt_completed);
                String completedColumn = cursor.getString(cursor.getColumnIndex(Db.COLUMN_COMPLETED));                  
                ImageView imgview = (ImageView)view.findViewById(R.id.icon_check);
                if(completedColumn.equals("T")){
                    imgview.setVisibility(View.VISIBLE);  
                }
            }
        };

多亏了Alex Lockwood,他在帖子中的回答解决了我的问题。我认为这很可笑,但像listView的wrap_内容这样的东西确实很重要!:)