это мой метод getView:
public View getView(final int position, View convertView, final ViewGroup parent) {
ViewHolder holder;
if(convertView == null){
holder = new ViewHolder();
convertView = inflater.inflate(R.layout.propviewlistrow, null);
holder.title = (TextView) convertView.findViewById(R.id.propviewlistrow_t1);
holder.content = (EditText) convertView.findViewById(R.id.propviewlistrow_e1);
convertView.setTag(holder);
}
else{
holder = (ViewHolder)convertView.getTag();
}
holder.title.setText(names.get(position));
holder.content.setText(values.get(position));
holder.content.addTextChangedListener(new TextWatcher(){
public void afterTextChanged(Editable s) {
values.set(position, s.toString());
}
public void beforeTextChanged(CharSequence s, int start,
int count, int after) {
}
public void onTextChanged(CharSequence s, int start,
int before, int count) {
}
});
return convertView;
}
}
Но это не работает.Тексты редактирования не отображают правильный текст, отображаемый текст переключается при прокрутке.Следующая проблема, я установил android: windowSoftInputMode = "AdjustPan" в манифесте.Если вы щелкнете по последнему тексту редактирования, просмотр списка будет недостаточно прокручиваться, чтобы вы могли видеть, что вы печатаете.