【发布时间】:2019-05-30 14:42:54
【问题描述】:
我正在使用UIView.animate 为我的约束设置动画。 drawerHeight 是一个约束变量。
代码如下:
drawerHeight?.constant = newHeight
UIView.animate(withDuration: 0.35, delay: 0, usingSpringWithDamping: 0.65, initialSpringVelocity: 2, options: .allowUserInteraction, animations: {
self.superview?.layoutIfNeeded()
})
Here is a video of what the issue looks like.
查看视频的底部,底部边缘似乎滞后。 为什么这些约束在动画时似乎滞后?
这是一个自我回答的问题。这篇文章是为了帮助未来的人们发现他们做错了什么,以及如何快速修复它。
【问题讨论】:
标签: ios swift autolayout nslayoutconstraint uiviewanimation