标签:
// 创建组动画对象 CAAnimationGroup *group = [CAAnimationGroup animation]; // 创建基本动画 // 平移 CABasicAnimation *anim1 = [CABasicAnimation animation]; anim1.keyPath = @"transform.translation.y"; anim1.toValue = @(400); // 缩放 CABasicAnimation *anim2 = [CABasicAnimation animation]; anim2.keyPath = @"transform.scale"; anim2.toValue = @(0); // 旋转 CABasicAnimation *anim3 = [CABasicAnimation animation]; anim3.keyPath = @"transform.rotation"; anim3.toValue = @(M_PI_4); // 设置动画数组 group.animations = @[anim1,anim2,anim3]; // 设置动画执行时间 group.duration = 2.0f; group.removedOnCompletion = NO; group.fillMode = kCAFillModeForwards; // 将动画添加到图片上面 [self.iconView.layer addAnimation:group forKey:nil];
标签:
原文地址:http://www.cnblogs.com/neilHoIOS/p/4628544.html