【发布时间】:2016-04-20 10:30:53
【问题描述】:
我正在使用 CGAffineTransformMakeRotation 来变换和旋转一米中的箭头。
Picture of arrow that animates inside gage
我面临的问题是,当我旋转超过 180 度时,箭头会逆时针旋转。
我的目标是在 1 到 280 度的范围内顺时针旋转箭头。
旋转箭头的函数示例:
func rotateNeedel(value: Int){
var value = 220 //for testing purpose
let degrees:CGFloat = CGFloat(value)
UIView.animateWithDuration(2.0, animations: {
self.ImgMaalerArrow.transform = CGAffineTransformMakeRotation((degrees * CGFloat(M_PI)) / 180.0)
})}
【问题讨论】:
标签: ios swift rotation uianimation