Reputation: 67
I set the tintcolor of two system image buttons via storyboard, it works perfectly in all simulators and with ios13. but if I try with real Iphone 5s with ios 12.4 the two buttons are not displayed, the only things that properly works is button background color. I tried programmaticaly with plusBtn.imageView?.tintColor = .yellow
or plusBtn.tintColor = .yellow
. but it's the same,it works with ios13 but not with iphone 5s.
This is iphone 11 Pro simulator:
and this is my real iphone5s device:
How can I set image tint color?
Upvotes: 3
Views: 1280
Reputation: 1333
You can try setting the image programmatically but you have to remove it from Attributes inspector in storyboard :) it solved the bug in iOS 12
Upvotes: 2
Reputation: 16341
You have to set the .withRenderingMode
property to .alwaysTemplate
for tintColor
to work.
plusBtn.imageView?.image?.withRenderingMode(.alwaysTemplate)
Upvotes: 2