Why SDWebImage do not show image in a cell after load?

风流意气都作罢 提交于 2019-12-06 03:44:55

Answer: get/make a transparent png, and use it as your placeholder image.

Actually, it is not a bug with SDWebImage, but rather it's the nature of how UITableView works. SetImageWithURL, is an asynch process. So when your tableView delegate/datasource methods are called, the image isn't downloaded yet, so cellForRow doesn't have an image to display.

The reason it works when you navigate elsewhere then back, is because by then the image has been downloaded, and cellForRow gets called again, this time with an image to display.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!