IOS - view order when creating a constraint

When creating a constraint (programmatically or from an interface constructor) does the order of representations matter? Does it matter what is the first element and is the second element?

+4
source share
1 answer

Yes, this is because the value is constantadded to the second element to determine the value of the first element.

So, if you have label2.leading = label1.trailing + 45, you will get something like:

enter image description here

But if you have label1.trailing = label2.leading + 45, you get:

enter image description here

label1 45 label2, , label2 label1

label1.trailing = label2.leading + -45, , : enter image description here

.

" Interface Builder", . , .

+1

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


All Articles