目前,我有以下改编者来拟定我的清单:
public class MyListAdapter extends ArrayAdapter<String> {
private Context mContext;
public MyListAdapter(Context context, int resource, int textViewResourceId,String[] objects) {
super(context, resource, textViewResourceId, objects);
// TODO Auto-generated constructor stub
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
Drawable cross = getResources().getDrawable(R.drawable.cross);
Drawable arrow = getResources().getDrawable(R.drawable.arrow);
View row = convertView;
if(row == null){
LayoutInflater inflater= getLayoutInflater();
row = inflater.inflate(R.layout.list_view_format2, parent, false);
}
TextView text =(TextView)row.findViewById(R.id.list_content2);
text.setText(list[position]);
ImageView image = (ImageView)row.findViewById(R.id.rightArrow);
TextView check = (TextView)row.findViewById(R.id.checker);
if (item != null && text.getText().toString().equals(item)){
text.setBackgroundDrawable(cross);
image.setImageDrawable(arrow);
check.setText("cross");
}
return row;
}
}
R.layout.list_view_format2: a custom ListView format. It contains an ImageView and a TextView R.id.list_content2: *Id of the Text View within R.id.list_view_format2*
如果搜查取得成功,我就试图改变儿童的某些部分。 然而,在我提出或提出清单时,并非仅仅修改了一名儿童,而是修改了其他儿童的布局。 我并没有确切了解正在发生的情况。 是否有人要解释?