public class appli extends Application {
@Override
public void onCreate() {
super.onCreate();
//Fresco的初始化
//磁盘缓存的配置
DiskCacheConfig diskCacheConfig = DiskCacheConfig.newBuilder(this)
.setBaseDirectoryPath(getCacheDir())
.setMaxCacheSize(8*1024*1024)
.build();
//把磁盘缓存的设置,设置到三级缓存中
ImagePipelineConfig pipelineConfig = ImagePipelineConfig.newBuilder(this)
.setMainDiskCacheConfig(diskCacheConfig)
.build();
Fresco.initialize(this,pipelineConfig);
}
}
Fresco注册三级缓存
最新推荐文章于 2022-08-24 15:05:38 发布