iOS 13: Segmented Controller background color issue

Begum Akbay
2 min readAug 23, 2020

While upgrading an app to iOS 13, I encountered weird issue with segmented controller. Setting white as background color for segmented controller wasn’t working. Sadly making changes on storyboard didn’t fix my issue. Segmented controller still had gray background color which is actually background image set by iOS. You will face with this issue if you are trying to set light color as background color.

To solve this issue, i written an extension to create an image with desired color:

To change background color:

Result

If you want to change selected/unselected text color as well:

Result

Edit:

I found another way to implement this: creating extension for segmented controller so all segmented controllers can have same ability. Here is the code:

Happy coding!!

--

--