How to change the color of an UIImage

后端 未结 7 484

I want not to change the backgroundColor of an UIImage,
but rather to change the color of the whole image.

Because I have got standard forms which I can move fr

7条回答
  •  隐瞒了意图╮
    2020-12-02 08:20

    You can also do this in swift with the following code:

    // language: Swift
    let tintedImage = UIImageView(image: UIImage(named:"whatever")!.imageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate))
    
    tintedImage.tintColor = UIColor.redColor()
    

提交回复
热议问题