检查此答案对您有帮助:
和
如果您的应用程序有很多图像并且还存在内存问题,那么您必须以自己的方式处理。
就像使用延迟加载在列表视图中下载图像一样。对于其他图像,请使用另一种方式,例如链接 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'