解决动画效果只能旋转 180的问题
2014-05-27 18:52
183 查看
转载自:http://code4app.com/requirement/53182a60933bf0b93e8b6293
如何用动画不断旋转一个uiview????
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.9];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationRepeatCount:100];
[self.inputView.fransform setUserInteractionEnabled:YES];
self.inputView.fransform.transform = CGAffineTransformMakeRotation(M_PI*2);
[UIView commitAnimations];
完全没效果,如果CGAffineTransformMakeRotation=M_PI得话又只能旋转180度,为什么呢?
CABasicAnimation* rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ];
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
rotationAnimation.duration = 2;
rotationAnimation.RepeatCount = 1000;//你可以设置到最大的整数值
rotationAnimation.cumulative = NO;
rotationAnimation.removedOnCompletion = NO;
rotationAnimation.fillMode = kCAFillModeForwards;
[rotateView.layer addAnimation:rotationAnimation forKey:@"Rotation"];
@小刚WHM : 哦,原来用layer动画!!!射射大神
如何用动画不断旋转一个uiview????
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.9];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationRepeatCount:100];
[self.inputView.fransform setUserInteractionEnabled:YES];
self.inputView.fransform.transform = CGAffineTransformMakeRotation(M_PI*2);
[UIView commitAnimations];
完全没效果,如果CGAffineTransformMakeRotation=M_PI得话又只能旋转180度,为什么呢?
CABasicAnimation* rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ];
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
rotationAnimation.duration = 2;
rotationAnimation.RepeatCount = 1000;//你可以设置到最大的整数值
rotationAnimation.cumulative = NO;
rotationAnimation.removedOnCompletion = NO;
rotationAnimation.fillMode = kCAFillModeForwards;
[rotateView.layer addAnimation:rotationAnimation forKey:@"Rotation"];
@小刚WHM : 哦,原来用layer动画!!!射射大神
相关文章推荐
- 解决使用属性动画没有效果,监听发现属性值未发生改变问题
- C#.net picturebox动画效果,刷新图像的闪烁问题解决方法
- 解决IOS7中LayoutConstraint动画无效果的问题
- 关于activity转场动画makeSceneTransitionAnimation没效果的问题的解决办法
- 关于火狐中使用jquery的animate做动画效果的问题解决
- cocos2dx3.0无法取消Armatrue骨骼动画中的补间效果问题的解决办法
- 关于旋转动画只能画少一个pai 的问题
- 解决 Button 设置 background 之后点击动画效果消失的问题
- Android 用surfaceview模拟帧动画的效果,解决帧动画的OOM问题
- TabHost overridePendingTransition() 解决动画效果无效的问题
- 图片执行放大动画后,不能保持放大效果问题解决
- VS2005 SP1发布,解决只能创建WebSite,无法创建Web Application项目的问题
- VS2005 SP1发布,解决只能创建WebSite,无法创建Web Application项目的问题
- 关于安装IIS 后 只能运行htm文件 不能运行ASP的问题解决
- 记录:解决2003server装完网卡驱动后只能访问内网问题
- WPF学习心得(1):WPF进行动画后不能改变相对应的属性问题的解决
- 阳初2440 超值版只能使用一个 USB Host 问题的解决
- 完美解决 文本框 只能输入数字问题
- VS2005 SP1发布,解决只能创建WebSite,无法创建Web Application项目的问题
- VS2005 SP1发布,解决只能创建WebSite,无法创建Web Application项目的问题 (转)