Why is my UIButton.tintColor not working?

后端 未结 13 1071
长情又很酷
长情又很酷 2020-12-03 04:15

My build target is set for IOS5 which is where I understand UIButton.tintColor was introduced...

I have this in my viewDidLoad for the View Controller

相关标签:
13条回答
  • 2020-12-03 05:05

    In iOS 13 you can tint the image and then set it to the button:

    let coloredImage = UIImage().withTintColor(UIColor.red)
    UIButton().setImage(coloredImage, for: .normal)
    
    0 讨论(0)
提交回复
热议问题