核心动画05-CAAnimationGroup
生活随笔
收集整理的這篇文章主要介紹了
核心动画05-CAAnimationGroup
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{//1、創(chuàng)建旋轉(zhuǎn)動(dòng)畫對(duì)象CABasicAnimation *rotate = [CABasicAnimation animation];rotate.keyPath = @"transform.rotation";rotate.toValue = @(M_PI);//2、創(chuàng)建縮放動(dòng)畫對(duì)象CABasicAnimation *scale = [CABasicAnimation animation];scale.keyPath = @"transform.scale";scale.toValue = @(0.0);//3、創(chuàng)建平移動(dòng)畫CABasicAnimation *move = [CABasicAnimation animation];move.keyPath = @"transform.translation";move.toValue = [NSValue valueWithCGPoint:CGPointMake(100, 100)];//4、將所有的動(dòng)畫添加到動(dòng)畫組中CAAnimationGroup *group = [CAAnimationGroup animation];group.animations = @[rotate,scale,move]; //次序無關(guān),這幾個(gè)動(dòng)畫同時(shí)執(zhí)行//這些屬性不再是添加到單個(gè)的動(dòng)畫上面,而是添加到整個(gè)的動(dòng)畫組上面
group.duration = 2.0;group.removedOnCompletion = NO;group.fillMode = kCAFillModeForwards;[self.myview.layer addAnimation:group forKey:nil];
}
?
轉(zhuǎn)載于:https://www.cnblogs.com/yipingios/p/4505707.html
總結(jié)
以上是生活随笔為你收集整理的核心动画05-CAAnimationGroup的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: loadrunner 分用户日志
- 下一篇: TCP与UDP网络编程总结(一)