When image gallery is wider than screen and I scroll it - images is re-loading all the time.
public class ImageAdapter extends BaseAdapter {
.....
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if(convertView == null){
holder = new ViewHolder();
convertView = getLayoutInflater().inflate(R.layout.gallery_item, parent, false);
holder.imageView = (ImageView) convertView.findViewById(R.id.ivGalleryItem);
convertView.setTag(holder);
}
else
{
holder = (ViewHolder) convertView.getTag();
}
....
Ion.with(context)
.load(holder.imagePath)
.withBitmap()
.intoImageView(imageView);
}
}
I asume Ion is caching image by default but gallery still hide and show it during scrolling.
So, where is my problem an d how to fix?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire