How can I color a UIImage in Swift?

后端 未结 20 2250
执念已碎
执念已碎 2020-11-29 18:27

I have an image called arrowWhite. I want to colour this image to black.

func attachDropDownArrow() -> NSMutableAttributedString {
    let im         


        
20条回答
  •  隐瞒了意图╮
    2020-11-29 18:56

    Swift 4

     let image: UIImage? =  #imageLiteral(resourceName: "logo-1").withRenderingMode(.alwaysTemplate)
        topLogo.image = image
        topLogo.tintColor = UIColor.white
    

提交回复
热议问题