以编程方式将 UIImage 添加到非编程方式的 ImageView SWIFT
Add UIImage programmatically into ImageView non programmatically SWIFT
我有这个 UIImage (A Gif)
let macacoGif = UIImage.gifWithName("macaco")
然后我在故事板上创建了这个 ImageView
@IBOutlet weak var fundo: UIImageView!
如何将这个 UIImage 添加到 ImageView 中?
UIImageView 有一个 .image 属性 你可以在其中设置你的 UIImage:
fundo.image = macacoGif
我有这个 UIImage (A Gif)
let macacoGif = UIImage.gifWithName("macaco")
然后我在故事板上创建了这个 ImageView
@IBOutlet weak var fundo: UIImageView!
如何将这个 UIImage 添加到 ImageView 中?
UIImageView 有一个 .image 属性 你可以在其中设置你的 UIImage:
fundo.image = macacoGif