Try to add this code programatically
if #available(iOS 13.4, *) {
self.datePicker.preferredDatePickerStyle = .wheels
}
Set preferdPickerStyle to your datepicker
if #available(iOS 13.4, *) {
self.datePicker.preferredDatePickerStyle = .wheels
} else {
// fallback to older version
}
From iOS 14.4 or above iOS change the design for the date picker view so in that case if you want to continue showing older design you have to do code as per the iOS version. and for that here is the version base condition code
if #available(iOS 13.4, *) {
self.datePicker.preferredDatePickerStyle = .wheels
}
here self.datepicker
is your datePicker object
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.