Imageloader配置和設定圓形

2021-07-12 06:56:00 字數 1698 閱讀 3751

imageloaderconfiguration config = new imageloaderconfiguration.builder(

.memorycacheextraoptions(480, 800)

// default = device screen dimensions 記憶體快取檔案的最大長寬

.diskcacheextraoptions(480, 800, null)

// 本地快取的詳細資訊(快取的最大長寬),最好不要設定這個

.threadpoolsize(3)

// default 執行緒池內載入的數量

.threadpriority(thread.norm_priority - 2)

// default 設定當前執行緒的優先順序

.tasksprocessingorder(queueprocessingtype.fifo)

// default

.denycacheimagemultiplesizesinmemory()

.memorycache(new lrumemorycache(2 * 1024 * 1024))

// 可以通過自己的記憶體快取實現

.memorycachesize(2 * 1024 * 1024)

// 記憶體快取的最大值

.memorycachesizepercentage(13)

// default

.diskcache(new unlimiteddiskcache(cachedir))

// default 可以自定義快取路徑

.diskcachesize(50 * 1024 * 1024)

// 50 mb sd卡(本地)快取的最大值

.diskcachefilecount(100)

// 可以快取的檔案數量

// default為使用hashcode對uil進行加密命名, 還可以用md5(new

// md5filenamegenerator())加密

.diskcachefilenamegenerator(new hashcodefilenamegenerator())

.image**********(

.defaultdisplayimageoptions(displayimageoptions.create******()) // default

.writedebuglogs() // 列印debug log

.build(); // 開始構建

imageloader.getinstance().init(config);

displayimageoptions options = new displayimageoptions.builder()

.showimageforemptyuri(r.drawable.a4)// 設定url為空或者錯誤的時候顯示的

.displayer(new roundedbitmapdisplayer(5))// 設定圓角

.cacheinmemory(true).build();

// list.get(position).thumbnail, h.im

imageloader.getinstance().displayimage(list.get(position).thumbnail,

h.im, options);

ImageLoader配置(注釋)

配置imageloader private void configimageloader memclass final int cachesize 1024 1024 memclass 4 logger.d memory cache size cachesize memorycacheextraop...

ImageLoader配置過程

imageloader使用詳解 github位址 配置imageloader public void initimageloader 在使用載入的類中去配置這些資源,比如在activity中進行配置 bash public void initoptions imageloader的使用 imagel...

ImageLoader配置引數

imageloader使用詳解 github位址 配置imageloader public void initimageloader 在使用載入的類中去配置這些資源,比如在activity中進行配置 bash public void initoptions imageloader的使用 imagel...