What exactly does lowering the priority of a constraint do?

若如初见. 提交于 2019-12-07 17:55:38

To answer the question in the headline: Lowering the priority of a constraint tells the autolayout that the constraint is less important than all constraints with a higher priority.

This means that if two constraints are conflicting autolayout will use the one with the highest priority and disregard the other.

If two required constraints with identical priorities conflict, you will have an error message like the one you describe.

Since you are setting the height at run time I would select the height/vertical constraint in IB you don't need at run time and turn the 'Placeholder' for the constraint to 'Remove at build time', this should remove your warnings.

The priority setting determines when there are conflicting constraints which one will be used.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!