CATransition type类型

CATransition *animation = [CATransition animation];

animation.duration = 1.0;

animation.type = @"cube"; //类型可以如下写

animation.subtype = kCATransitionFromRight;

[self.view.layer addAnimation:animation forKey:nil];


2.1 public类型  公有的类型的动画类型

animation.type 的类型可以有

淡化、推挤、揭开、覆盖

NSString * const kCATransitionFade;

NSString * const kCATransitionMoveIn;

NSString * const kCATransitionPush;

NSString * const kCATransitionReveal;

这四种,transition.subtype 也有四种

NSString * const kCATransitionFromRight;

NSString * const kCATransitionFromLeft;

NSString * const kCATransitionFromTop;

NSString * const kCATransitionFromBottom;


2.2 私有的类型的动画类型:立方体、吸收、翻转、波纹、翻页、反翻页、镜头开、镜头关

animation.type = @"cube"
animation.type = @"suckEffect";  
animation.type = @"oglFlip";//不管subType is "fromLeft" or "fromRight",official只有一种效果
animation.type = @"rippleEffect"; 
animation.type = @"pageCurl"; 
animation.type = @"pageUnCurl"
animation.type = @"cameraIrisHollowOpen ";
animation.type = @"cameraIrisHollowClose ";

2.3 CATransition的 startProgress  endProgress属性

这两个属性是float类型的。
可以控制动画进行的过程,可以让动画停留在某个动画点上,值在0.0到1.0之间。endProgress要大于等于startProgress。
比如上面的立方体转到,可以设置endProgress= 0.5,让动画停留在转动一般的位置。

2.4 UIView嵌套使用

  [UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionRepeat animations:^{

        //view变透明 

    } completion:^(BOOL finished) {

        [UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionRepeat animations:^{  

            //view恢复回来

        } completion:^(BOOL finished) {

        }];

        

    }];




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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值