Is there a way to access the priority restrictions placed by UIStackView?

I get "Unable to satisfy constraints at the same time" when using the UIStackView.hidden property.

I know this because, because I set the distribution to β€œevenly” and β€œInterval” to 1, and then hide the UIStackView, it tries to set its height to zero to enliven the hide, so that it will have several competing priorities 1000 that hinders the creation of the above warnings.

I could solve the problem and resolve the warning if I could access the restrictions created by UIStackView, whose priorities are automatically set to 1000.

If I could somehow find a way to reduce these priorities to 999 in order to defeat the hiding priority, I could avoid the warning.

So my question is, is there a way to find the space restrictions created by UIStackView that go into the StackView definition in the storyboard and assign priority to 999?

Type sort: for all restrictions in the stack view {if constrain is the interval type {set constrain priority to 999}} or some other algorithm.

+5
source share

Source: https://habr.com/ru/post/1241345/


All Articles