I am struggling with autolayout in Interface Builder.
I am having the following layout:
-------------------------------
| |
| _____________________ |
| | | |
|<-->| UILabel |<-->|
| | | |
| --------------------- |
| <-------------------> |
-------------------------------
What I want to accomplish:
I want the UILabel to have a width of 300, unless the left/right margin becomes less then 30. In that case the UILabel's width must be smaller so the left/right margin will always be 30.
What I tried:
UILabel Width: Less then or equal: 300
Left/Right Leading/Trailing: Greater than or equal: 30
This works in layouts that don't fit the 360 width, so the UILabel becomes smaller. However, when I have like 400 width available, the UILabel becomes 280 and the Leading/Trailing becomes 50...
I have experimented with different priorities, but nothing seems to have a real effect. I also tried to set the UILabel width constraint to equal
, but that did not work on widths smaller then 360.
Is there a solution to this problem?