我正在尝试为我的应用制作动画。我想将图像移到UIView
(动画背景)的中心,然后更改该UIView
(背景)的高度,这时出现了问题-我的图像转到原始位置。这是我的代码:
UIView.animate(withDuration: 0.3, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 1, options: .curveEaseIn, animations: {
animationView.alpha = 1
}) { (true) in
UIView.animate(withDuration: 0.3, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 1, options: .curveEaseIn, animations: {
infoImage.center.x = animationView.center.x
}) { (true) in
UIView.animate(withDuration: 1, delay: 0.5, usingSpringWithDamping: 0.7, initialSpringVelocity: 1, options: .curveEaseIn, animations: {
animationView.frame = CGRect(x: 8, y: cellFrame.minY, width: cellFrame.width - 16, height: cellFrame.height + 200)
}) { (true) in
print("completed")
}
}
}
答案 0 :(得分:0)
这是因为您要覆盖x值。
add2DF()