這就是我在頁面加載時看到屏幕的方式。但是當我開始滾動列表時,所有記錄開始改變,變得非常奇怪。我真的不知道爲什麼,有什麼建議?ListView在滾動時更改記錄
這是屏幕後,我通過我的ListView
上下滾動。
適配器:
private class TechnicalDocumentationAdapter extends
ArrayAdapter<TechnicalDocumentation> {
private ArrayList<TechnicalDocumentation> items;
public TechnicalDocumentationAdapter(Context context,
int textViewResourceId, ArrayList<TechnicalDocumentation> items) {
super(context, textViewResourceId, items);
this.items = items;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.technicaldocumentationrow, null);
}
TechnicalDocumentation technicalDocumentation = items.get(position);
if (technicalDocumentation != null) {
TextView tt = (TextView) v.findViewById(R.id.TDRdate);
TextView bt = (TextView) v.findViewById(R.id.TDRobjectTypeCode);
TextView ct = (TextView) v
.findViewById(R.id.TDRperformedAction);
TextView at = (TextView) v.findViewById(R.id.TDRobjectName);
tt.setText(tt.getText() + "\n " + technicalDocumentation.date);
bt.setText(bt.getText() + "\n "
+ technicalDocumentation.objectTypeCode);
ct.setText(ct.getText() + "\n "
+ technicalDocumentation.performedAction);
at.setText(at.getText() + "\n "
+ technicalDocumentation.objectName);
}
return v;
}
}
發佈您的適配器也.. –