这就是我在页面加载时看到我的屏幕的方式。但是当我开始滚动列表时,我所有的记录都开始发生变化,这变得非常奇怪。我真的不知道为什么,有什么建议吗?
这是我上下滚动后的屏幕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;
}
}