美好的一天!
我在EditText中携带一个ListView,用户可以滚动在EditText中输入的值更改位置。
我该如何处理?
谢谢!
方法getView():
public View getView(final int position, View convertView, ViewGroup parent){
final Sapatos sapato = lista.get(position);
if (convertView == null){
LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
holder = new ViewHolder();
convertView = inflater.inflate(R.layout.list_pedidos, null);
holder.img = (ImageView) convertView.findViewById(R.id.imgPed);
holder.edt = (EditText)convertView.findViewById(R.id.editText1);
final LinearLayout layout;
layout = (LinearLayout)convertView.findViewById(R.id.LayoutPed);
convertView.setTag(holder);
} else{
holder = (ViewHolder) convertView.getTag();
}
holder.img.setImageResource(sapato.getImagem());
holder.edt.setText(""); //adicionei somente esta linha
return convertView;
final Sapatos sapato = lista.get(position);
if (convertView == null){
LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
holder = new ViewHolder();
convertView = inflater.inflate(R.layout.list_pedidos, null);
holder.img = (ImageView) convertView.findViewById(R.id.imgPed);
holder.edt = (EditText)convertView.findViewById(R.id.editText1);
final LinearLayout layout;
layout = (LinearLayout)convertView.findViewById(R.id.LayoutPed);
convertView.setTag(holder);
} else{
holder = (ViewHolder) convertView.getTag();
}
holder.img.setImageResource(sapato.getImagem());
holder.edt.setText(""); //adicionei somente esta linha
return convertView;
答案 0 :(得分:0)
我猜测,你喜欢你的Sapatos在列表视图中显示,并且在使用时会更改某些属性执行文本编辑。你错过了(至少)以下: