I saw this question but it doesn't work in SwiftUI.
Changing text color of datepicker
I tried .forgroundColor
and .accentColor
but they don't change the texts' color.
Using .colorInvert()
and .colorMultiply(.white)
will change the text color to white but won't work when the device is in Dark Mode. Instead, try this:
DatePicker("Date", selection: $selection)
.colorScheme(.dark) // or .light to get black text
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