动画--左右晃动

2015-09-21  本文已影响166人  舒耀
CAKeyframeAnimation *animation = [CAKeyframeAnimation animation];
animation.keyPath = @"position.x";//左右晃动  position.y上下晃动
animation.values = @[@0,@10,@-10,@10,@0];//位置点
animation.keyTimes = @[@0,@(1/6.0),@(3/6.0),@(5/6.0),@1];//时间点
animation.duration = 0.2f;//晃动持续时间
animation.additive = YES;
[shakeView.layer addAnimation:animation forKey:@"shake"];
上一篇 下一篇

猜你喜欢

热点阅读