Core Animation的相关知识

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以及其他



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值