Is it any way to change text color of datepicker in iOS8? I\'ve that it isn\'t possible in iOS7 and prior, something changed in 8th version?
For example I\'ve found
I found a way that wasnt listed here or in the other thread. https://stackoverflow.com/a/59838215/4266735
I ran into a similar issue with the latest SwiftUI / Swift 5 on XCode 11. All of the options above did not work and the DatePicker either stayed black text or crashed.
In your SwiftUI file set init() before var body
init() {
UIDatePicker.appearance().backgroundColor = .clear
}
Then in your var body view do this
DatePicker(selection: $dob, in: ...Date(), displayedComponents: .date) {
Text("Select Date")
}.colorInvert()
That inverted the black text to be white using the iOS Dark Theme. Looks/works great. Hope this helps.
I've changed text color through inspector (see below)