Search code examples
iosuibuttonuisegmentedcontrol

Remove tint from UISegmentedControl images iOS


I have a UISegmentedControl which has 3 images rather than text. The images are all colored however the UISegmentedControl forces a tint on them which simply overrides their colors to blue or whatever color the tint is. Giving it a tint of UIColor.clear makes the images completely transparent.
From what I have gathered by reading various posts on here is that in case of a UIButton, removing the tint is done by setting the Type to Custom instead of System but I don't see this option for UISegmentedControl.
Is this a limitation? Should I use regular UIButtons instead? Any other work arounds?
Thanks


Solution

  • There is one way what you can do is set Render mode of your Image to Original Image. To set this select your image in Assets, after that in Attributes Inspector set Render As to Original Image, check below image for reference.

    enter image description here

    Output:

    Before changing render mode

    enter image description here

    After changing render mode

    enter image description here