1. 程式人生 > >fresco自定義快取路徑

fresco自定義快取路徑

記得加許可權!記得加許可權!記得加許可權!  讀寫磁碟的許可權 

 //設定磁碟快取
        DiskCacheConfig diskCacheConfig =  DiskCacheConfig.newBuilder(this)
                .setBaseDirectoryName("images_zjj")
                .setBaseDirectoryPath(Environment.getExternalStorageDirectory())
                .build();
        //設定磁碟快取的配置,生成配置檔案
        ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
                .setMainDiskCacheConfig(diskCacheConfig)
                .build();
        Fresco.initialize(this,config);