I am a bit stumped as to how to properly define constraints that will collapse the space between views when a given view is removed. I have tried adding vertical constraints with a greater than or equal relation, however, it seems that the min distance to satisfy the constraint is not preferred.
For example, given the following layout with three constraints V:[A]-5-[B], V:[B]-5-[C], and V:[A]-(>=5)-[C]:
[ View A ]
|
5 pt
|
[ View B ]
|
5 pt
|
[ View C ]
After removing view B I want it to look like this:
[ View A ]
|
5 pt
|
[ View C ]
But it looks like this:
[ View A ]
|
5 pt + 5 pt + height of view B
|
[ View C ]
You could add V:[A]-5-[C] with a lover priority, below 1000.
[superview]
|
[ View A ]
| |
5 pt (1000) |
| |
[ View B ] 5 pt (999)
| |
5 pt (1000) |
| |
[ View C ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With