zoukankan      html  css  js  c++  java
  • CATransition 动画

    1.    [UIView commitAnimations];
          [UIView beginAnimations:nil context:nil];
    2.               [UIView setAnimationRepeatAutoreverses:YES];//动画是否返回 
         
          [UIView setAnimationDuration:0.3];
         
          button.alpha =0;
         
         
          [UIView commitAnimations];
    3.  CATransition的type属性 
    4.   
    5.  1.#define定义的常量 
    6.      kCATransitionFade   交叉淡化过渡 
    7.      kCATransitionMoveIn 新视图移到旧视图上面 
    8.      kCATransitionPush   新视图把旧视图推出去 
    9.      kCATransitionReveal 将旧视图移开,显示下面的新视图 
    10.   
    11.  2.用字符串表示 
    12.      pageCurl            向上翻一页 
    13.      pageUnCurl          向下翻一页 
    14.      rippleEffect        滴水效果 
    15.      suckEffect          收缩效果,如一块布被抽走 
    16.      cube                立方体效果 
    17.      oglFlip             上下翻转效果  
    18.   
    19. - (void)MyCAnimation1 {   
    20.       
    21.     CATransition *animation = [CATransition animation];  
    22.     //动画时间  
    23.     animation.duration = 1.0f;  
    24.     //display mode, slow at beginning and end  
    25.     animation.timingFunction = UIViewAnimationCurveEaseInOut;  
    26.     //过渡效果  
    27.     animation.type = kCATransitionMoveIn;  
    28.     //过渡方向  
    29.     animation.subtype = kCATransitionFromTop;  
    30.     //添加动画  
    31.     [imageView.layer addAnimation:animation forKey:nil];  
    32. }  
    33.   
    34. - (void)MyCAnimation2 {   
    35.       
    36.     CATransition *animation = [CATransition animation];  
    37.     //动画时间  
    38.     animation.duration = 1.0f;  
    39.     //display mode, slow at beginning and end  
    40.     animation.timingFunction = UIViewAnimationCurveEaseInOut;  
    41.     //在动画执行完时是否被移除  
    42.     animation.removedOnCompletion = NO;  
    43.     //过渡效果  
    44.     animation.type = @"pageCurl";  
    45.     //过渡方向  
    46.     animation.subtype = kCATransitionFromRight;  
    47.     //暂时不知,感觉与Progress一起用的,如果不加,Progress好像没有效果  
    48.     animation.fillMode = kCAFillModeForwards;  
    49.     //动画停止(在整体动画的百分比).  
    50.     animation.endProgress = 0.7;  
    51.     [imageView.layer addAnimation:animation forKey:nil];  
    52. }  
    53.   
    54. - (void)MyCAnimation3 {   
    55.       
    56.     CATransition *animation = [CATransition animation];  
    57.     //动画时间  
    58.     animation.duration = 1.0f;  
    59.     //display mode, slow at beginning and end  
    60.     animation.timingFunction = UIViewAnimationCurveEaseInOut;  
    61.     //过渡效果  
    62.     animation.type = @"pageUnCurl";  
    63.     //过渡方向  
    64.     animation.subtype = kCATransitionFromRight;  
    65.     //暂时不知,感觉与Progress一起用的,如果不加,Progress好像没有效果  
    66.     animation.fillMode = kCAFillModeBackwards;  
    67.     //动画开始(在整体动画的百分比).  
    68.     animation.startProgress = 0.3;  
    69.     [imageView.layer addAnimation:animation forKey:nil];  
    70. }  
    71.   
    72. - (void)MyCAnimation4 {   
    73.       
    74.     [NSTimer scheduledTimerWithTimeInterval:3.0f target:self selector:@selector(updateButterfly) userInfo:nil repeats:YES];  
    75. }  
    76.   
    77. - (void)updateButterfly {  
    78.   
    79.     butterflyView.animationDuration = 0.75f;  
    80.     [self.view addSubview:butterflyView];  
    81.     [butterflyView startAnimating];  
    82.     butterflyView.center = [butterflyView randomCenterInView:self.view withInset:10.0f];  
    83.   
  • 相关阅读:
    robots.txt
    procdump和mimikatz工具配合破解windows账户口令
    通过vbs脚本控制方向盘按键
    批处理删除文件或文件夹代码
    彩色线条雨特效html代码
    secureCRT
    chrome 更新flash插件
    python命令行下安装redis客户端
    FastJson使用
    Redis 学习(二)
  • 原文地址:https://www.cnblogs.com/gaoxiao228/p/2483580.html
Copyright © 2011-2022 走看看