Images In Listview Are Repeated
I'm parsing vk's group wall. Some posts have photos(from 1 to 10), some don't have. And I need to display them. However, all the images are repeated. And I can't make them appear c
Solution 1:
Try
ImageView img;
inside ViewHolder class and then use it as
viewHolder.img = viewHolder.photo;
viewHolder.img.setTag(photo_100);
imageLoader.DisplayImage(photo_100, viewHolder.img);
Solution 2:
Issue should be due to the ListView
recycle.
Try to override getViewTypeCount
and getItemViewType
If your view types are different then return the type count, e.g. if 3 different types,then
@Override
publicintgetViewTypeCount() {
return3;
}
And, then tell the ListView
which position of item is different from other, e.g., if position 0 and 1 are different from other items then change it like this
@OverridepublicintgetItemViewType(int position){
// return a unique numberif(position == 0){
return0;
}
if(position == 1){
return1;
}
else {
return2;
}
}
Post a Comment for "Images In Listview Are Repeated"