How To Use universal image loader offline caching?

前端 未结 5 1122
南方客
南方客 2020-12-05 08:37

Is it possible to catch offline using universal image loader? If possible, how to use it? Using configs? How To Set Download Directory manually?

out of memory erroro

5条回答
  •  不知归路
    2020-12-05 09:02

    If you are using Xamarin : Add Below code in OnCreateView or similar is available in Java also.

    DisplayImageOptions options = new DisplayImageOptions.Builder().CacheInMemory(true).CacheOnDisk(true).Build();
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this.Context).DefaultDisplayImageOptions(options).Build();
    ImageLoader.Instance.Init(config);
    

    Add below line of code, when loading image

    ImageLoader imageLoader = ImageLoader.Instance;
    imageLoader.DisplayImage(imgURL, imageSource);
    

提交回复
热议问题