UIViewKeyframeAnimationOptions
全部标签 我尝试使用下面的代码在屏幕上创建一个连续旋转的正方形。但我不知道为什么转速在变化。我怎样才能改变代码使转速不变?我尝试了不同的UIViewKeyframeAnimationOptions,但似乎都不起作用。overridefuncviewDidLoad(){super.viewDidLoad()letsquare=UIView()square.frame=CGRect(x:55,y:300,width:40,height:40)square.backgroundColor=UIColor.redColor()self.view.addSubview(square)letduration
我尝试使用下面的代码在屏幕上创建一个连续旋转的正方形。但我不知道为什么转速在变化。我怎样才能改变代码使转速不变?我尝试了不同的UIViewKeyframeAnimationOptions,但似乎都不起作用。overridefuncviewDidLoad(){super.viewDidLoad()letsquare=UIView()square.frame=CGRect(x:55,y:300,width:40,height:40)square.backgroundColor=UIColor.redColor()self.view.addSubview(square)letduration