onmyway133 / blog

🍁 What you don't know is what you haven't learned
https://onmyway133.com/
MIT License
676 stars 33 forks source link

How to set date color in UIDatePicker in iOS 13 #535

Open onmyway133 opened 4 years ago

onmyway133 commented 4 years ago
datePicker.setValue(UIColor.green, forKey: "textColor")
datePicker.setValue(false, forKey: "highlightsToday")

In iOS 14

if #available(iOS 14.0, *) {
    datePicker.preferredDatePickerStyle = .wheels
    datePicker.tintColor = UIColor.green
}

Inspect attributes

rajasekhar-pasupuleti commented 2 years ago

Hello, iOS 16 doesn't changing todays date colour when I use the above code. Any inputs or workarounds?

lilubin1992 commented 2 years ago

Hello, iOS 16 doesn't changing todays date colour when I use the above code. Any inputs or workarounds?

hello, have you resolve this question on iOS 16?

huangzhengguo commented 1 year ago

appDelegate.window?.overrideUserInterfaceStyle = .dark my App today alaways black. when I set dark mode the today textcolor change to white