SDWebImage + UITableViewCell, wrong image when scrolling?

前端 未结 5 1894
失恋的感觉
失恋的感觉 2021-02-06 04:08

i\'m having an issue using SDWebImage to load images to a UIImageView inside a custom UITableViewCell. This is my code at the UITableView delegate:

    static NS         


        
5条回答
  •  温柔的废话
    2021-02-06 04:42

    Example of answer above. Swift 3

    func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
        (cell as! UITableViewCell).imageView.image = nil
        (cell as! UITableViewCell).imageView.sd_cancelCurrentImageLoad()
    }
    

提交回复
热议问题