How do you create a UIImage View Programmatically - Swift

前端 未结 8 1698
梦如初夏
梦如初夏 2020-12-02 04:23

I\'m trying to create a UIImage View programmatically, I have a new view and I tried doing this

let imageName = \"yourImage.png\"
yourview.backgroundColor =          


        
8条回答
  •  广开言路
    2020-12-02 05:17

    You can use above in one line.

      let imageView = UIImageView(image: UIImage(named: "yourImage.png")!)
    

提交回复
热议问题