CAKeyframeAnimation 失效的疑问
UIButton * btn = [[UIButton alloc]initWithFrame:CGRectMake(100, 100, 50, 50)];
btn.backgroundColor = [UIColor blackColor];
[self.view addSubview:btn];
CGRect boundingRect = CGRectMake(-100, -100, 300, 300);
CAKeyframeAnimation *orbit = [CAKeyframeAnimation animation];
orbit.keyPath = @"position";
orbit.path = CFAutorelease(CGPathCreateWithEllipseInRect(boundingRect, NULL));
orbit.duration = 4;
orbit.additive = YES;
orbit.repeatCount = HUGE_VALF;
orbit.calculationMode = kCAAnimationPaced;
orbit.rotationMode = kCAAnimationRotateAuto;
[btn.layer addAnimation:orbit forKey:@"orbit"];
这个是动画的代码。
我在MainViewController 里面 直接贴上上面的代码 是可以正常运行的。
我在MainViewController里面
FirstViewController * vc = [[FirstViewController alloc]initWithNibName:nil bundle:nil];
[self presentViewController:vc animated:YES completion:^(void){
}];
present了一个 FirstViewContoller 在这个FirstViewContollr里面 为什么动画就没有效果了呢?
求教~~~
...全文
相关推荐
CAKeyframeAnimation动画(UILabel左右晃动)
iOS-Swift-CAKeyframeAnimation动画(UILabel左右晃动) http://blog.csdn.net/u014220518/article/details/53289570
GYPetalAnimation:使用CAKeyframeAnimation实现花瓣特效
GYPetalAnimation 使用CAKeyframeAnimation实现花瓣特效 简单的动画实例,使用CAKeyframeAnimation实现效果
CAKeyframeAnimation orbit动画
CAKeyframeAnimation 轨迹动画
CAKeyframeAnimation CABasicAnimation CAAnimationGroup demo
iOS CAKeyframeAnimation CABasicAnimation CAAnimationGroup demo 动画范例
ios-使用CAKeyframeAnimation实现过山车动画.zip
纯代码用swift实现的一个过山车动画,大家可以一起学习一下,还挺有意思的,代码的github下载地址:https://github.com/631106979/RollerCoasterAnimation,代码详解的博客地址:http://blog.csdn.net/wang631106979/article/details/51737456,大家觉得学到东西的可以给点个赞,有什么疑问可以去我的博客留言,谢谢大家的支持


