0

I added Date picker view as keyboard controller on the UItextfiewld still now it was working properly but in latest version of iOS 14.4 getting date picker view very small. here I am attaching the screenshot for it

enter image description here

How we can solve this in iOS 14.4 ?

Sky Clones
  • 26
  • 3
  • What difference does the iOS version make when you use the date picker with the simulator? – El Tomato Jul 16 '21 at 08:25
  • you may need to set the new date picker style if you are looking for the classical date picker as wheel, see https://developer.apple.com/documentation/swiftui/datepickerstyle – Luca Iaco Jul 16 '21 at 08:29

3 Answers3

0

Try to add this code programatically

if #available(iOS 13.4, *) {
   self.datePicker.preferredDatePickerStyle = .wheels
}
Hardik Thakkar
  • 15,269
  • 2
  • 94
  • 81
0

Set preferdPickerStyle to your datepicker

if #available(iOS 13.4, *) {
  self.datePicker.preferredDatePickerStyle = .wheels
} else {
  // fallback to older version 
}
Abhishek
  • 329
  • 3
  • 12
0

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

Mitul Bhadeshiya
  • 1,280
  • 1
  • 12
  • 32