ios中的动画

占坑

CoreAnimation在哪一层?在OpenGL之上,OpenGL在Graphics Hardware之上。CoreGraphics干什么的。

CAAnimation

CABaseAnimation 大小,颜色,透明度

CAKeyAnimation 关键帧你做什么,路径。

//UIView动画一


//  交换本视图控制器中2个view位置
    [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];


//UIView动画二
    [UIView transitionFromView:(self.view)
                       toView:(self._view2)
                       duration:1.0
                       options:UIViewAnimationOptionTransitionCurlUp
                       completion:^(BOOL finished) {
                        }
     ];

//UIView动画三

[UIView animateWithDuration:0.65f  
                      delay:0.5f  
                    options:UIViewAnimationOptionCurveEaseIn  
                 animations:^  
 {  
      //确定UIView的的中心位置和偏转角度  
     self.imgView.center = CGPointMake(80.0f, 108.0f);  
     self.imgView.transform = CGAffineTransformMakeRotation(-0.22f);  
       
     self.imgView.center = CGPointMake(160.0f, 93.0f);  
     self.imgView.transform = CGAffineTransformMakeRotation(-0.1f);  
       
 }  
                 completion:nil];  
                   



//UIView动画四

 ,ios3.0以前

    //UIView开始动画,第一个参数是动画的标识,第二个参数附加的应用程序信息用来传递给动画代理消息
    [UIView beginAnimations:@"View Flip" context:nil];
    //动画持续时间
    [UIView setAnimationDuration:1.25];
    //设置动画的回调函数,设置后可以使用回调方法
    [UIView setAnimationDelegate:self];
    //设置动画曲线,控制动画速度
    [UIView  setAnimationCurve: UIViewAnimationCurveEaseInOut];
    //设置动画方式,并指出动画发生的位置
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view  cache:YES];
    //提交UIView动画
    [UIView commitAnimations];


//


做什么动画,一般都有什么动画,怎么做


block-based ios4以上 


animateWithDuration:animations


以前的
beginAnimations:context: and commitAnimations
多个语句:


可以被搞成动画的几个属性:




   * 
  @property frame
   * 
  @property bounds
   * 
  @property center
   * 
  @property transform
   * 
  @property alpha
   * 
  @property backgroundColor
   * 
  @property contentStretch


注意啦:只有在建View的时候可以不在主线程,其他UIView相关的事情都得在主线程做

你可能感兴趣的:(ios中的动画)