この回答を確認してください。
と
アプリに多くの画像があり、メモリの問題もある場合は、独自の方法で処理する必要があります。
遅延読み込みを使用してリストビューで画像をダウンロードするように。他の画像については、リンク 2 のような別の方法を使用します。
スクロールの問題については、getView()
次のようにアダプタのコードを確認してください。
public class ListViewAdapter extends BaseAdapter {
private LayoutInflater mInflater;
public ListViewAdapter(Context con) {
// TODO Auto-generated constructor stub
mInflater = LayoutInflater.from(con);
}
public int getCount() {
// TODO Auto-generated method stub
return SoapParser.title_date.size();
}
public Object getItem(int position) {
// TODO Auto-generated method stub
// return product_id1.size();
return position;
}
public long getItemId(int position) {
// TODO Auto-generated method stub
// return product_id1.get(position).hashCode();
return position;
}
public View getView(final int position, View convertView,
ViewGroup parent) {
// TODO Auto-generated method stub
final ListContent holder;
View v = convertView;
if (v == null) {
v = mInflater.inflate(R.layout.row_tb, null);
holder = new ListContent();
holder.date = (TextView) v.findViewById(R.id.textView1);
holder.actual = (TextView) v.findViewById(R.id.textView2);
holder.targate = (TextView) v.findViewById(R.id.textView3);
v.setTag(holder);
} else {
holder = (ListContent) v.getTag();
}
holder.date.setId(position);
holder.actual.setId(position);
holder.targate.setId(position);
holder.date.setText(" " + SoapParser.title_date.get(position));
holder.actual.setText(" " + SoapParser.title_actual.get(position));
holder.targate
.setText(" " + SoapParser.title_targate.get(position));
return v;
}
}
レイアウトで他のビューを使用している場合は、それを作成してくださいandroid:focusable='false'