📜  swift set uiimage color - Swift 代码示例

📅  最后修改于: 2022-03-11 15:00:58.141000             🧑  作者: Mango

代码示例1
extension UIImageView {
  func setImageColor(color: UIColor) {
    let templateImage = self.image?.withRenderingMode(.alwaysTemplate)
    self.image = templateImage
    self.tintColor = color
  }
}