TableView中的SDWebImage向上滚动

时间:2017-02-09 05:47:12

标签: swift tableview tableviewcell sdwebimage

我在SDWebImage项目swift 3.0.1中使用xcode 8.1。 我可以从远程网址下载图片,并在cell的动态tableview的图片视图中显示。

当我向tableview向上滚动时,图像会缩小。

1 个答案:

答案 0 :(得分:0)

我使用了这段代码,它为我工作。

 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
            let cellId:String = "cellid"
            let cell = tableView.dequeueReusableCell(withIdentifier: cellId, for: indexPath) as! customcell
            let strUrlProfilepic = your image url path

        self.yourImageView.af_setImage(withURL: strUrlProfilepic, placeholderImage: UIImage(named: "PlaceholderImage.jpeg"))
            return cell
        }
相关问题