Inequality Constraint Ambiguity

前端 未结 4 733
没有蜡笔的小新
没有蜡笔的小新 2021-01-31 04:00

i\'ve a problem in resizing a UIView with Autolayout and constraints. I\'d like to change the origin (less than or equal of original) and the width (greater than or equal of or

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-31 04:39

    I tried to make more than 1 vertical spacing constraint shrink for 3.5" displays, so I had to make 2 constraints between components that I wanted to shrink on smaller screen. One constraint was inequality (greater or equal) where I specified minimum required size, with 1000 priority, other constraint was equality constraint with specific size that is suitable for 4" screen, but with lower priority of 250.

    This way Xcode stopped complaining and layout repositioned properly on smaller screen.

    enter image description here

提交回复
热议问题