0
我有一個自定義listadapter列表視圖。在適配器的getView方法內部,我初始化了行的佈局。每行內部都有一個TextView。如何將特定值加載到listview的ViewHolder項目中?
我想將特定值傳遞給特定行的TextViews。可能嗎?
適配器代碼是在這裏:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
final Model model = arrList.get(position);
if (row == null) {
row = inflater.inflate(R.layout.list_row, null, false);
holder = new ViewHolder();
holder.text = (TextView) row.findViewById(R.id.textview);
holder.button = (Button) row.findViewById(R.id.okbutton);
holder.numberPicker = (com.lol.helen.widgets.NumberPicker) row.findViewById(R.id.numb_pickr);