FS.O6 FS.O6 - 1 month ago 10
Swift Question

How to make a UITabBarItem ignore the tintColor

I have a

UITabBar
with 5 tabs.

I set an "unselectedImage" to tabBarItem's
image
property and "selectedImage" to tabBarItem's
selectedImage
property.

The "selectedImage" is an image with a gradient, but it presents it in the color of the
tabBar.tintColor
.

So how can I cancel the
tintColor
and make the original image to be presented (without coloring it with the
tintColor
)?

Thanks!

Answer

When you set the image, define the rederingMode:

yourUIImage.renderingMode = alwaysOriginal