我有一个UITextField,我想在放大时扩大它的宽度。我设置了约束条件,并确保左边的约束具有较低的优先级,然后是我试图在右边进行动画处理的约束。试图在动画中制约动画约束
这是我正在尝试使用的代码。
// move the input box
UIView.animateWithDuration(10.5, animations: {
self.nameInputConstraint.constant = 8
}, completion: {
(value: Bool) in
println(">>> move const")
})
这有效,但它似乎只是立即发生,似乎没有任何运动。我试图将它设置为10秒以确保我没有错过任何东西,但我得到了相同的结果。
nameInputConstraint是我控制从IB连接到我的班级的约束的名称。
感谢您的帮助提前!
可能重复[我怎样动画约束的变化?(http://stackoverflow.com/questions/12622424/how-do-i-animate-constraint-changes) – 2015-09-20 16:33:53