1

I used the following code to display an inline datepicker, and used a State variable to control whether show the datapicker or not.

When I tap on the datepicker, it will popup a keyboard. Is it possible to disable the popup keyboard? What I want is just let user to scroll the datepicker.

HStack {
    ... // some text
    if reminderToggle {
        DatePicker("", selection: $timestampHour, in: closedRangeTime, displayedComponents: [.hourAndMinute])
            .datePickerStyle(GraphicalDatePickerStyle())
            .accentColor(Color("ColorYellow"))
            .labelsHidden()
    } else {
        EmptyView()
    }

}

enter image description here @pawello2222 Hello, I used your dismiss keyboard on tap method in this case. It works well on iPhone, but not on iPad. That number pad is not useable. When you tap on the number, it will be dismissed. How can I fix it? https://stackoverflow.com/a/63942065/15922168

Yu23333
  • 46
  • 5

0 Answers0