我正在使用 Facebook Fresco 库和 SimpleDraweeView 来显示文件中的头像图像:
Uri avaURI = Uri.fromFile(new File(getCacheDir(), Constants.AVA_FILE_NAME));
simpleDrawee.setImageURI(avaURI);
但是,如果我更改了带有图片的文件(删除了以前的文件并使用新图像创建了相同的文件),我该如何更新(刷新)SimpleDraweeView?它仍然显示旧版本的图像。 (我尝试通过禁用缓存Fresco.getImagePipeline().evictFromMemoryCache(avaURI);
但这没有帮助)。
我相信你走在正确的道路上。旧映像可能存在于另外两个级别的存储中,最有可能从中拉回旧映像。我相信这些会在 60 天后过期,因此也需要冲洗。
Fresco.getImagePipeline().evictFromMemoryCache(avaURI);
Fresco.getImagePipelineFactory().getMainDiskStorageCache().remove(new SimpleCacheKey(avaURI.toString()));
Fresco.getImagePipelineFactory().getSmallImageDiskStorageCache().remove(new SimpleCacheKey(avaURI.toString()));
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)