Saeed Rahmatolahi
Saeed Rahmatolahi

Reputation: 1338

how to use custom icon with 2 color in tabor in swift 3?

I want to add special icon with 2 color in the tab bar but the app detect just one color I used lots of single color icons and there is no problem with them but this icon won't show as I want to be here is the image of that Icon here is the image

the tabor background is white

Upvotes: 0

Views: 198

Answers (3)

Aleksandr Honcharov
Aleksandr Honcharov

Reputation: 2513

Try to set color you want using this code.

UITabBar.appearance().tintColor = .red

Or you can tell the system to keep the original rendering mode, so it does not use default colors. Set image like that.

... = UIImage(named:"myImage.png")?.withRenderingMode(.alwaysOriginal)

Upvotes: 0

Shubham
Shubham

Reputation: 773

If you are using image assets then change the render option as Original Image instead of Default.

enter image description here

Otherwise change the tint color of tabor to clear.

Upvotes: 0

Anurag Mishra
Anurag Mishra

Reputation: 41

try to use .jpg of the image in place of .png

Upvotes: 2

Related Questions