Home  >  Q&A  >  body text

ios - SDWebImage 是怎么解决图片错位的

黄舟黄舟2762 days ago438

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 16:59:43

    You can take a closer look at sd_setImageWithURL: 方法的内部实现,其实每次调用该方法都会先 Cancel 掉这个UIImageView the operations being performed by the previous request, and then start a new download, using runtime technology to access relevant data, thus avoiding the problem of Cell reuse.

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 16:59:43

    Recurrence should be a problem of cell reuse. When the image on a cell is not loaded and the cell happens to be reused, the image on the cell will display the previous image. The solution is to set the image to nil in the cell's prepareforreuse.

    reply
    0
  • Cancelreply