【问题标题】:How to display local JPG image in a PFImageView如何在 PFImageView 中显示本地 JPG 图像
【发布时间】:2016-01-20 21:09:20
【问题描述】:

我有几个 PFImageViews 可以显示从 Parse 下载的图像。但是,我希望能够在需要时加载一张本地图像。由于某种原因,此代码不起作用。非常感谢任何帮助,谢谢!

cellForRowAtIndexPath:

let checkInImage = UIImage(named: "checkin.jpg")!
let checkInFile = UIImageJPEGRepresentation(checkInImage, 1.0)!
let imagePFFile = PFFile(data: checkInFile)!

tableViewCell.PFImageViewOne.file = imagePFFile
tableViewCell.PFImageViewOne.loadInBackground()

【问题讨论】:

    标签: swift image parse-platform


    【解决方案1】:

    由于 PFImageView 是 UIImageView 的子类,您应该可以像这样将图像视图的图像属性设置为您的图像:

    tableViewCell.PFImageViewOne.image = checkInImage
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-19
      • 2023-03-15
      • 2019-05-27
      • 2010-11-24
      • 1970-01-01
      • 1970-01-01
      • 2017-05-27
      • 1970-01-01
      相关资源
      最近更新 更多