Our UIPickerView has a dark background and the selection lines are incredibly hard to see. Is there anyway to change them to a colour of my choosing?
Update: I'm talking about the --- above and below the "Panda" item.
Cat
Dog
Elephant
-----------
Panda
-----------
Bear
Giraffe
Swift 4.2
func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
pickerView.subviews[1].backgroundColor = UIColor.white
pickerView.subviews[2].backgroundColor = UIColor.white
return view
}
This works for me!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With