UIView动画不工作 - Xcode (Swift)

问题描述 投票:0回答:1

例如: 我没有看到任何动画。为什么?

UIView.animate(withDuration: 1, delay: 0, options: [.repeat, .autoreverse], animations: {
    self.buttonTrial.transform = CGAffineTransform(scaleX: 1.2, y: 1.2)
}, completion: { completion in
    self.buttonTrial.transform = .identity
})
ios swift xcode uiview
1个回答
0
投票

你的代码工作正常。我删除了 completion 因为它是不需要的,但除此之外,这是用的。恰恰 你显示的代码。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.