2017-02-09 66 views
0

我在我的swift 3.0.1项目中使用SDWebImagexcode 8.1。 我能够从远程URL下载图像,并在tableview的动态cell的图像视图中显示。TableView中的SDWebImage向上滚动

当我在tableview中向上滚动时,会出现问题,图像缩小。

+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 
     } 
+0

我使用了上面的代码.. self.yourImageView.af_setImage(withURL:strUrlProfilepic,placeholderImage:UIImage(named:“PlaceholderImage.jpeg”))。现在正在工作。 – Rupesh

+0

如果我的回答对你有帮助,则接受我的回答。谢谢 –