简体   繁体   中英

turn off UIPickerView gradient

I created a UIPickerView that I would like to not have that fade on the edges.

First I thought that must be some kind of gradient overlay so I recursively hid all UIImageViews within the UIPickerView and also set all layer.contents to nil. Setting a background color different to white to the picker view reveals that the fade cannot be an overlay, since the labels in the picker view now fade to the background color.

Does anybody have an idea on how to find that layer mask and turn it off?

EDIT

I just checked if there are any CALayers with masks, but there are none.

This is not exactly the answer to my question but at least a solution. I found a custom (horizontal) AKPickerView on GitHub which is available for Obj-C and Swift (1.2 and 2.0). This View has an undocumented property maskDisabled which does exactly what I need.

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