If displaying the datePicker there is a strange behavior.
If pressing the button, then the time picker will appear, but while appearing the picker sound is noticeable. This is a little bit annoying. Why is this happening? If I remove the GraphicalDatePickerStyle then this disappears, but I want that the wheel can be dragged in the same place. I don't want a detail view popup which would be really annoying.
In result the time picker should go on top of a date picker which is showing the calendar, so I want to have a picker view which shows the date+time without having to go into a detail view. Thanks a lot for answers.
struct ContentView: View {
@State var toggle = false
@State var date = Date(timeIntervalSinceNow: 0)
var body: some View {
ZStack{
Button("sdflkj"){
toggle.toggle()
}
VStack{
Spacer()
if toggle{
DatePicker("lsadjf", selection: $date, displayedComponents: .hourAndMinute)
.labelsHidden()
.datePickerStyle(GraphicalDatePickerStyle())
}
}
}
}
}