UIViewAnimation动画与Core Animation的CATransition类动画

UIViewAnimation
- (void)leftClick {   
  
    [UIView beginAnimations:nil context:nil];  
    //display mode, slow at beginning and end  
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];  
    //动画时间  
    [UIView setAnimationDuration:1.0f];  
    //使用当前正在运行的状态开始下一段动画  
    [UIView setAnimationBeginsFromCurrentState:YES];  
    //给视图添加过渡效果  
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:imageView cache:YES];  
    [UIView commitAnimations];  
}    
/
 1.#define定义的常量 
     kCATransitionFade   交叉淡化过渡 
     kCATransitionMoveIn 新视图移到旧视图上面 
     kCATransitionPush   新视图把旧视图推出去 
     kCATransitionReveal 将旧视图移开,显示下面的新视图 
  
 2.用字符串表示 
     pageCurl            向上翻一页 
     pageUnCurl          向下翻一页 
     rippleEffect        滴水效果 
     suckEffect          收缩效果,如一块布被抽走 
     cube                立方体效果 
     oglFlip             上下翻转效果   
*/  
- (void)MyCAnimation1 {   
      
    CATransition *animation = [CATransition animation];  
    //动画时间  
    animation.duration = 1.0f;  
    //display mode, slow at beginning and end  
    animation.timingFunction = UIViewAnimationCurveEaseInOut;  
    //过渡效果  
    animation.type = kCATransitionMoveIn;  
    //过渡方向  
    animation.subtype = kCATransitionFromTop;  
    //添加动画  
    [imageView.layer addAnimation:animation forKey:nil];  
}  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值