我正在尝试设置精灵大小的动画。大小发生变化,但没有任何动画。
这是有问题的代码:
UIView.animate(withDuration: 1, animations: {
self.char_trail.size.width += 10
})
我希望char_trail的大小能够平稳变化,但是稍后会调整大小。告诉我我在做什么错,请
尝试这个:
UIView.animate(withDuration: 1, delay: 1, usingSpringWithDamping: 0.5, initialSpringVelocity: 5, options: .curveEaseInOut, animations: {
self.char_trail.size.width += 10
})