If anyone else having issues with DatePicker.
struct Date: View {
@State private var date = Date()
var body: some View {
VStack {
Text("Enter your birthday")
.font(.largeTitle)
DatePicker("Enter your birthday", selection: $date)
}
}
}
[LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x600001798d20 h=--& v=--& _UIDatePickerCalendarTimeView:0x1431607a0.height == 0 (active)>",
"<NSLayoutConstraint:0x60000178eda0 _UIDatePickerCompactTimeLabel:0x143169260.centerY == _UIDatePickerCalendarTimeView:0x1431607a0.centerY - 1 (active)>",
"<NSLayoutConstraint:0x60000178edf0 V:|-(>=0)-[_UIDatePickerCompactTimeLabel:0x143169260] (active, names: '|':_UIDatePickerCalendarTimeView:0x1431607a0 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60000178eda0 _UIDatePickerCompactTimeLabel:0x143169260.centerY == _UIDatePickerCalendarTimeView:0x1431607a0.centerY - 1 (active)>