Modify UIImage renderingMode from a storyboard/xib file

前端 未结 16 2353
别那么骄傲
别那么骄傲 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:38

    In iOS 9 setting the tintColor property in Interface Builder is still buggy.

    Note that a working solution besides writing lines directly modifying ImageView properties is to set Render As: Template Image in the asset catalog, and call e.g.:

    [[UIImageView appearanceWhenContainedInInstancesOfClasses:@[[MyView class]]] setTintColor:[UIColor whiteColor]];
    

提交回复
热议问题