iOS小菜一碟:1:用代码修改图片颜色
- 首先需要是Xcode的assets里面的图片

-
选中图片
DraggedImage-1.png
- 在属性面板里可以看到Render As,选择Template Image

- 在使用图片的视图中利用tintColor控制图片颜色(比如UIImageView,UIButton):
v.tintColor=UIColor.redColor()
v.tintColor=UIColor.redColor()
选中图片
v.tintColor=UIColor.redColor()
v.tintColor=UIColor.redColor()
本文标题:iOS小菜一碟:1:用代码修改图片颜色
本文链接:https://www.haomeiwen.com/subject/mevehttx.html
网友评论