0
我正在使用通用圖像加載程序,但每次向上和向下滾動時都會重新加載圖像。Android - GridView滾動正在通用圖像加載器中重新加載圖像
我正在使用下面的代碼。
配置 - >
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
.memoryCache(new WeakMemoryCache())
.denyCacheImageMultipleSizesInMemory()
.discCacheFileNameGenerator(new Md5FileNameGenerator())
.tasksProcessingOrder(QueueProcessingType.LIFO)
// .enableLogging() // Not necessary in common
.build();
// Initialize ImageLoader with configuration.
ImageLoader.getInstance().init(config);
選項 - >
options = new DisplayImageOptions.Builder()
.resetViewBeforeLoading()
.imageScaleType(ImageScaleType.EXACTLY)
.cacheInMemory(true)
.bitmapConfig(Bitmap.Config.RGB_565)
.build();
視圖 - >
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View workingview = inflater.inflate(R.layout.gridview_item_photo_icon, null);
ImageView imageView = (ImageView) workingview.findViewById(R.id.picture);
ImageAware imageAware = new ImageViewAware(imageView, false);
imageLoader.displayImage("file://" + imageUrls.get(position), imageAware, options, new SimpleImageLoadingListener());
return workingview;
}
請讓我知道我要去哪裏錯了。