I'm trying to cover a datepicker with a text view since the SwiftUI datepicker isn't very customizable. This way I can control how the label looks with different colors than the datepicker.
The problem i'm running into is that the datepicker doesn't register taps when something is placed on top of it. Either in a ZStack or a .overlay.
I've tried many different workaround such as setting the .opacity to zero in front of the text
ZStack {
DatePicker("Due Date", selection: $startDate, displayedComponents: .date)
.labelsHidden()
.cornerRadius(10)
.allowsHitTesting(true)
Text("hi this is text")
.allowsHitTesting(false)
}
Any help?