我在自定义列表视图中有一个文本视图,我知道如何设置文本颜色,以便更改列表中的所有文本视图。但是现在,我只想让一个特定的视图改变颜色,比如列表视图中有 10 个项目,我只想改变第二个文本视图的颜色,其余的保持不变。任何想法?非常感谢大家的帮助~
public class CheckWinNoAdapter extends ArrayAdapter<String> {
private final Context context;
private String[] values;
public CheckWinNoAdapter(Context context, String[] values) {
// TODO Auto-generated constructor stub
super(context, R.layout.list_draw, values);
this.context = context;
this.values = values;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowView = inflater.inflate(R.layout.list_draw, parent, false);
TextView textView1 = (TextView) rowView.findViewById(R.id.chk_tv1);
textView1.setText(values[position]);
}
}