Using iOS14.0.1, Swift5.3, Xcode12.0.1,
I try to change the textColor
of a UIDatePicker
in iOS14 and using UIKit.
I read here that you need the following method to do so:
let myDatePicker = UIDatePicker()
myDatePicker.tintColor = .white
I also tried the following (but that makes my app crash under iOS14):
myDatePicker.setValue(UIColor.white, forKeyPath: "textColor")
I also tried (but without success either):
UILabel.appearance(whenContainedInInstancesOf: [UIDatePicker.self]).textColor = UIColor.white
In light mode, none of my trials work (as can bee seen in the screenshot-excerpt):
What do I need to do to get the white color text in my UIDatePicker
?