简体   繁体   中英

Uipicker background blur

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?

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 ie last subview.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM