【发布时间】:2015-08-05 21:53:17
【问题描述】:
【问题讨论】:
-
动画是 + 和 x 动画,就像当有人点击 + 时它会旋转到 x
-
你的问题到底是什么?
-
你可以做一个旋转动画 - stackoverflow.com/questions/5725099/…
标签: ios xcode swift animation rotation
【问题讨论】:
标签: ios xcode swift animation rotation
Swift 3:
UIView.animate(withDuration: 0.25, animations: {
myButton.transform = CGAffineTransform(rotationAngle: CGFloat.pi)
})
更多关于 Swift 中旋转的信息: Swift: How can you rotate text for UIButton and UILabel?
【讨论】:
您可以在按钮上使用常规旋转:
[myButton setTransform:CGAffineTransformMakeRotation(M_PI_4)];
这将旋转 + 45 度并使其成为 X :)
如果您也想制作动画,请尝试
[UIView animateWithDuration:.5 animations:^{
myButton.transform = CGAffineTransformMakeRotation(M_PI_4);
}];
【讨论】: