如何优化具有多个视图的列表视图以进行扩充

时间:2014-10-14 11:20:44

标签: android performance android-listview out-of-memory listadapter

我正在尝试使用具有6种不同类型转换视图的自定义列表视图来充气,如

LayoutInflater inflater = (LayoutInflater) _context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
switch(case)
{
case 1:
view = inflater.inflate(R.layout.item1, null);
break;
case 2:
view = inflater.inflate(R.layout.item2, null);
break;
case 3:
view = inflater.inflate(R.layout.item3, null);
break;
case 4:
view = inflater.inflate(R.layout.item4, null);
break;
case 5:
view = inflater.inflate(R.layout.item5, null);
break;
default: 
break;
}

我对所有上述视图有完全不同的视图,并且加载了许多图像 现在问题是我想优化它,因为列表非常长,并且大多数时候也会导致内存不足。 请指导我,提前致谢

0 个答案:

没有答案