Yeongchan Jeon Yeongchan Jeon - 1 year ago 86
iOS Question

An UIBarButtonItem is colored with tint color. Can I get this displayed as it is?

The image below is the original one I want to display:

enter image description here

And I also put the following statement.

leftBtn.image = UIImage(named: "logo")

However, the image is displayes like the following one. I set the tint color as that dark grey.

enter image description here

Referencing this website disable tint on custom uibarbuttonitem images, I put this statement but it didn't make any change.


Is there any other way to make the image shown as I want? Any advice would be appreciated!

Answer Source

You should try this

leftBtn.image = UIImage(named: "logo").imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download