For some reason, the background of my switch control is grey and I can’t figure out why. I’ve checked all the backgrounds of the views that are anywhere close to this control and they are all the same red color as you see in the image below.
What is causing the switch’s background to appear gray?
How is this switch initialized? Is it created in the storyboard or programmatically?
Other thing that i would suggest is to check if there is usage of the UIAppearence class. Look for something like this:
Thanks Nikita, I don’t initialize the switch in code at all. But I will try changing the background color using a similar statement to the right color. I’ll let you know what I find.
Just as a note, the background of that screen used to be dark gray, but then I changed it to red. So, I have a feeling there’s some view that has a gray background that’s causing this issue.
Just in case, i would suggest you to make that view background to UIColor.clear, so you don’t have to change it’s background every time you change the color of the screen.
Hi nikita, I had some code that was changing the background colour to gray. I missed it the first few times I was looking at my code. Thanks for responding!