0
我想將選擇器固定在特定的列表項上我正在做這個LvQuestion.setSelection(Integer.parseInt(InsertIndexNo)); LvQuestion.setSelector(R.drawable.quiz_edit_text_colored);
但這不起作用。列表視圖的固定選擇器
我想將選擇器固定在特定的列表項上我正在做這個LvQuestion.setSelection(Integer.parseInt(InsertIndexNo)); LvQuestion.setSelector(R.drawable.quiz_edit_text_colored);
但這不起作用。列表視圖的固定選擇器
所申請的其餘行的ListView顏色capplied藍色和青色試試這個答案,你應該在適配器獲取視圖重寫此方法,
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent);
if (position == 2) {
view.setBackgroundColor(Color.BLUE);
} else {
view.setBackgroundColor(Color.CYAN);
}
return view;
}
在這個代碼2位。
是否要在列表視圖中更改所選項目的顏色 –
我想修復索引號爲2的列表項目的背景 –
要更改列表項目索引號2或全部的背景或對於偶數行項目清單 –