我有一个UIImage
,是一个全黑的小符号.UIImage
是在自定义UIButton
子类中设置的.有没有可能让图像将tintColor
应用于它,因此它会将 colored颜色 更改为tintColor
是什么,而不是黑色图像?
我只是想避免创造新的assets资源 .
// here I want defaultImageName (that is black) to use the tintColor (that is white)
[self setImage:[UIImage imageNamed:defaultImageName] forState:UIControlStateNormal];