I need to change the text color of my .inline
style Date Picker.
A Google search led me to this post.
This works perfectly on .wheels
style, but doesn't work on .inline
:
My code:
class ViewController: UIViewController {
@IBOutlet weak var datePicker: UIDatePicker!
override func viewDidLoad() {
super.viewDidLoad()
datePicker.preferredDatePickerStyle = .inline
self.datePicker.backgroundColor = .blue
datePicker.setValue(UIColor.white, forKeyPath: "textColor")
datePicker.tintColor = .systemTeal
}
}
Any help will be appreciated.