Android功能代码

Fresco配置自定义外部缓存路径和缓存大小

2019-07-27  本文已影响0人  cc_And

在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);
上一篇 下一篇

猜你喜欢

热点阅读