https://github.com/nostra13/Android-Universal-Image-Loader
除了列表视图中的第一个项目取消了其图像加载任务外,它工作得很好。
它说Is called when image loading task was cancelled because View for image was reused in newer task
但是,由于该视图仍然清晰可见,因此该视图不应该被回收吗?我正在使用转换视图。
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
if (getItemViewType(position) == HAS_IMAGE)
{
if (convertView == null)
{
convertView = li.inflate(R.layout.item_update_pic, null);
new UpdateWithImageWrapper(convertView, position); // this is where views are looked up and set
}
((UpdateWithImageWrapper) convertView.getTag()).setMyData(data.get(position), position); // this is where the correct data is set to the views and images are set to be loaded
}
else
{
if (convertView == null)
{
convertView = li.inflate(R.layout.item_update, null);
new UpdateNoImageWrapper(convertView, position);
}
((UpdateNoImageWrapper) convertView.getTag()).setMyData(data.get(position), position);
}
return convertView;
}
有没有人有解决方案?
编辑:只是想补充一点,我的所有列表视图都有问题。
使用 ImageLoader 1.8.4
也许有一种方法可以阻止列表视图如此快速地回收?