【发布时间】:2019-11-05 19:24:04
【问题描述】:
【问题讨论】:
-
这仍然只是将整个彩色像素更改为一种颜色。任何人都有实现这一目标的理想?就像使用 svg 文件什么的。我已经通过使用 LightingColorFilter 在 android 中完成了这项工作。
【问题讨论】:
你可以这样试试:
self.img.image = self.img.image?.withRenderingMode(.alwaysTemplate)
self.img.tintColor = UIColor.black
【讨论】:
let tableImage: UIImageView = {
let image = UIImageView()
image.image = image.withRenderingMode(.alwaysTemplate)
image.tintColor = .white
return image
}()
试试这个,这将改变你的图像 tintColor。我不认为你可以在图像中设置多种颜色
【讨论】: