How to set the background color of UIPickerView on iOS 7 using SDK 7?

Dmitry picture Dmitry · Oct 1, 2013 · Viewed 34.8k times · Source

How to set the background color of UIPickerView on iOS 7 using SDK 7 and use a standard picker on iOS 5 and 6? It's transparent by default on iOS 7.

Answer

Jesse picture Jesse · Oct 21, 2013

What's wrong with:

[picker setBackgroundColor:[UIColor whiteColor]];

I'm assuming you have a reference to the picker view if you're invoking it, and it's a subclass of UIView so backgroundColor is a valid property...