У меня есть 3 UIViews - view1, view2, view3.Я устанавливаю ограничения в раскадровке следующим образом:
- view1.leading = safeArea.leading + 0 (ограничение 1 как IBOutlet),
- view2.leading = view1.leading,
- view3.leading = view2.leading
Затем я изменяю константу в constraint1 в коде.Я ожидаю, что view1, view2, view3 автоматически выровняются при изменении view1.leading.Но вместо этого я получаю ошибки автопоставки:
[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.
(
"<NSLayoutConstraint:0x283317a70 UIView:0x10321f7d0.leading == UILayoutGuide:0x28290ddc0'UIViewSafeAreaLayoutGuide'.leading (active)>",
"<NSLayoutConstraint:0x283316bc0 UIView:0x10321f7d0.leading == UILayoutGuide:0x28290ddc0'UIViewSafeAreaLayoutGuide'.leading + 5 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x283316bc0 UIView:0x10321f7d0.leading == UILayoutGuide:0x28290ddc0'UIViewSafeAreaLayoutGuide'.leading + 5 (active)>
Что я делаю не так?