When a uipicker gets presented to a screen. The background has a Light grey blur effect in the background by default. How do I change the color of this haze?
Asked
Active
Viewed 141 times
-1
-
1There is no such thing as a "uipicker". – matt Apr 13 '22 at 12:39
1 Answers
1
Try using the below code.
pickerView.subviews.last?.backgroundColor = .red.withAlphaComponent(0.2)
UIPickerView consists of 2 subviews. One is the main container and the second one is the selection indicator. So we just simply change the background of the second i.e last subview.

Prabh Kaur
- 36
- 1
- 5
-
This solution might easily break in the future if the structure of the `UIPickerView` changes. – Cristik Apr 13 '22 at 13:21