【发布时间】:2018-01-17 05:23:44
【问题描述】:
我正在做一个例子,因为我采取了 2 个类似的约束
topconstarints = 150,优先级为 999
和
top2constraint = 0 优先级为 998
当我改变优先级时
topconstarints.priority = 998
和
top2constraint.priority = 999
然后我调用 updateConstraintsIfNeeded() 然后它不会对更改进行动画处理,但是如果约束的优先级为 1000,并且如果我更改了该约束,那么它正在工作,所以任何人都可以解释一下这里发生了什么
【问题讨论】:
-
容器视图只需要调用 layoutIfNeeded
-
好的,但为什么它不能与 UpdateConstraintsIfNeeded 一起使用,但它的优先级为 1000
标签: ios swift swift3 autolayout