Reputation: 31
in iOS 14 the UIPickerView has default a grey background on the selected Row,
I can't find a way to change it
Upvotes: 2
Views: 1599
Reputation: 305
Just to clarify, the code:
if #available(iOS 14.0, *) { pickerView.subviews[1].backgroundColor = .clear }
needs to go in the following protocol method:
func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
}
Upvotes: 2
Reputation: 31
if #available(iOS 14.0, *) { pickerView.subviews[1].backgroundColor = .clear }
Upvotes: 0