0
私は、制約にアニメーションを適用して、ビューにlogoImageを持っています。 アニメーション化された制約は、幅と高さです。 220.0の元の状態から240.0になり(うまくいきます)、220.0に戻したいのですが、アニメーションはスキップされ、画像は0.1秒から220.0に直接戻ります。ここでスウィフトは1つのアニメーションをスキップします(UIView.animate)
は、アニメーションのコードは、私が得ることができるすべての助けを事前に
func animate() {
self.imageHeightConstraint.constant = 240.0
self.imageWidthConstraint.constant = 240.0
UIView.animate(withDuration: 1.0,
delay:0.0,
options: .curveEaseIn,
animations:{
self.logoImage.layoutIfNeeded()
}, completion: { (finished: Bool) -> Void in
self.imageHeightConstraint.constant = 220.0
self.imageWidthConstraint.constant = 220.0
UIView.animate(withDuration: 2.0,
delay:0.0,
options: .curveEaseIn,
animations: {
self.logoImage.layoutIfNeeded()
})
})
}
感謝です! ;-)
!どうもありがとうございます ;) – Julien