I am trying to change the background color of the UISearchbar. I am able to set the background to any color but white. Not sure why white does not get set. I am using the below code snippets to set the color. I have an extension method to get the textField. So, you can assume that textField exists.
searchBar.backgroundColor = .white
searchBar.textField?.backgroundColor = .white
It always has gray color when I set it to white.

However, if I use a color other than white it shows up that color.
searchBar.textField?.backgroundColor = .blue
Any idea what is wrong here.
