Modify UIImage renderingMode from a storyboard/xib file

前端 未结 16 2355
别那么骄傲
别那么骄傲 2020-12-02 08:00

Is it possible to modify a UIImage\'s renderingMode from a storyboard or xib editor?

The goal is to apply tintColor to the par

16条回答
  •  青春惊慌失措
    2020-12-02 08:34

    If you create an IBOutlet you can change it in your awakeFromNib method like so...

    self.myImageView.image = [self.myImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
    

    While @Moby's answer is more correct - this might be more succinct.

提交回复
热议问题