How can i change foreground color in new DatePicker for iOS 14?
VStack (alignment: .center, spacing: 0)
{
DatePicker(selection: self.$enddate, in: self.endMinDate()...self.endMaxDate()) {
Text("Start")
}.labelsHidden().colorMultiply(MyColor.bluecolor)
}.foregroundColor(MyColor.bluecolor)
Old DatePicker in iOS 13 without problem:
I don't have your colors but the following should work.
Tested with Xcode 12.1 / iOS 14.1
VStack (alignment: .center, spacing: 0)
{
DatePicker(selection: self.$enddate, in: self.endMinDate()...self.endMaxDate()) {
Text("Start")
}.labelsHidden()
}
.accentColor(MyColor.bluecolor) // << this one !!
//.accentColor(.red) // << used for demo
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