0
我有一个nslayoutconstraint,当用户按下按钮时,约束应该慢慢达到零。目前它只是在按下按钮时自动快速达到零。我的代码不起作用。这里是。慢动画动作
@IBAction func Expansion(_ sender: AnyObject) {
UIView.animate(withDuration: 0.1, animations: {
self.ScrolliewTopConstraint.constant = 0
self.ScrollView.isScrollEnabled = true
}, completion: nil)
}
你是什么意思 – user7222919
我已经设定常数 – user7222919
将其设置动画之前。然后动画'layoutIfNeeded()'。 – Mundi