[英]Does SDWeb image caching the downloaded imaged automatically ?
我有一個簡單的集合視圖,其中有一個從URl下載的圖像
我試圖使用SD Web圖像,而不是緩存這些圖像
這是我的代碼
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "carOwnerCell", for: indexPath) as! CarOwnerCollectionViewCell
cell.requestImage.sd_setShowActivityIndicatorView(true)
cell.requestImage.sd_setImage(with: URL(string: "My url "))
return cell
}
圖像下載但每次我在集合中滾動時都會繼續下載圖像。如何使用SD網頁圖像緩存下載圖像
首先,您應檢查(“我的網址”)是圖像的正確URL,然后給出占位符圖像,如果它顯示占位符圖像意味着工作正常
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.