这样做,我相信我的图像只是缓存在磁盘上:
ImageService.Instance.LoadUrl(item.profileImg) .DownSample() .BitmapOptimizations(true) .LoadingPlaceholder("blank_profile_img.png", FFImageLoading.Work.ImageSource.CompiledResource) .Into(holder.imgIcon);
据我所知,您只需指定要用于该特定图像的缓存类型,因为它是针对密钥存储的 .
所以我使用这个库的一个例子是这样的:
ImageService.Instance.LoadUrl(url) .WithPriority(LoadingPriority.High) .Retry(3, 200) .LoadingPlaceholder("ProfilePlaceholder.png", ImageSource.CompiledResource) .ErrorPlaceholder("ProfilePlaceholder.png", ImageSource.CompiledResource) .WithCache(FFImageLoading.Cache.CacheType.All) .Into(profileImage);
关键部分是:
.WithCache(FFImageLoading.Cache.CacheType.All)
您可以指定 All ,这意味着它将缓存到 IO 和 memory ,或者您可以选择它只是 IO ,或者只是 memory .
All
IO
memory
所以你的看起来像:
ImageService.Instance.LoadUrl(item.profileImg) .DownSample() .BitmapOptimizations(true) .LoadingPlaceholder("blank_profile_img.png", FFImageLoading.Work.ImageSource.CompiledResource) .WithCache(FFImageLoading.Cache.CacheType.All) .Into(holder.imgIcon);
1 回答
据我所知,您只需指定要用于该特定图像的缓存类型,因为它是针对密钥存储的 .
所以我使用这个库的一个例子是这样的:
关键部分是:
您可以指定
All
,这意味着它将缓存到IO
和memory
,或者您可以选择它只是IO
,或者只是memory
.所以你的看起来像: