1、CALayer: 猫猫学IOS(三十七)UI之CALayer
在layer中添加图片:layer.contents = (id)[UIImage imageName:].CGImage
2、CoreAnimation:猫猫学IOS(三十八)UI之核心动画简介
3、CAPropertyAnimation:子类1:CABaisicAnimation: 核心动画之CABasicAnimation(基础动画)
子类2:CAKeyframeAnimation:核心动画_抖动效果_CAKeyframeAnimation
上文中的方法用M_PI *2后不能动了,改用下面的方法可以旋转360度 :
rotateAnimation.keyPath = @"transform.rotation.z"
rotationAnimation.toValue = [NSNumber numberWithDouble: M_PI *2 ];
平移:法1:
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"position"];
anim.fromValue = [NSValue valueWithCGPoint:CGPointMake(50, 80)]; anim.toValue = [NSValue valueWithCGPoint:CGPointMake(300, 350)];[_myView.layer addAnimation:anim forKey:@"translate"];法2:
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"transform"]; CATransform3D form = CATransform3DMakeTranslation(350, 350, 0); anim.toValue = [NSValue valueWithCATransform3D:form]; [_myView.layer addAnimation:anim forKey:nil];法3:
CABasicAnimation* windMillBasic = [CABasicAnimation animation];
windMillBasic.keyPath = @"transform.rotation.z";
windMillBasic.toValue = [NSNumber numberWithDouble:M_PI * 2.0];
[_windMill.layer addAnimation:windMillBasic forKey:nil];
缩放:@"bounds"[NSValue valueWithCGRect:CGRectMake(0, 0, 30, 30)];@"transform"
[NSValue valueWithCATransform3D:CATransform3DMakeScale(2, 1.5, 1)];
旋转:
@"transform"
[NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI_4, 0, 0, 1)];
4、CATransition:UI之核心动画之CATransition
5、CAAnimationGroud:http:UI之核心动画CAAnimationGroup以及其他