简体   繁体   English

UIView animation 不工作 - Xcode (Swift)

[英]UIView animation not working - Xcode (Swift)

Example: I don't see any animation.示例:我没有看到任何 animation。 Why?为什么?

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
})

Your code works fine.您的代码工作正常。 I removed the completion as it is not needed, but apart from that, this was done with exactly the code you've shown.我删除了completion ,因为它不需要,但除此之外,这是完全使用您显示的代码完成的。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM