Ambiguity with two inequality constraints

前端 未结 1 1164
独厮守ぢ
独厮守ぢ 2021-01-07 23:54

\"screenshot\"

I want to have the bottom view be at least 20 away from both the image and the

相关标签:
1条回答
  • 2021-01-08 00:26

    I think you can do it like this, if I understand your requirements:

    enter image description here

    The image view has a fixed width and height, and constraints to the left side and top, as well as a constraint to the bottom view of =20 with a priority of 700. That's crucial -- that will set the y position of that bottom view (which has fixed height and constraints to the two sides), but will allow it to move lower if another constraint with higher priority makes it. That constraint with higher priority is the constraint to the label -- it's >=20 with priority of 1000 (the label also has constraints to the top, right side, and trailing edge of the image view).

    0 讨论(0)
提交回复
热议问题