在application中初始化
ImagePipelineConfig pipelineConfig = ImagePipelineConfig.newBuilder(this)
.setMainDiskCacheConfig(DiskCacheConfig.newBuilder(this)
.setBaseDirectoryPath(Environment.getDownloadCacheDirectory())//设置外部SD卡缓存目录文件
.setBaseDirectoryName("cc/")//设置缓存名称
.setMaxCacheSize(10*1024*1024)//设置缓存大小
.build())
.build();
//初始化
Fresco.initialize(this, pipelineConfig);
网友评论