ios开发随笔第二天 简单动画的实现

    首先对视图要有一定的了解,这里我就不多介绍了,

    先说一种已经基本不用的头尾式动画 

    首先 设置一个view  UIView * testView = [UIView alloc]init];

    确定位置  self.testView.frame = CGRectMake(0,0,50,50);

    开始动画

   [ UIView beginAnimations:nil context: nil   ]

    设置动画持续时间

    [UIView  setAnimationDuration:2.0]

    可动画属性数值

    self.testView.frame = rect ;

    self.testView.backgroundColor = [UIColor blueColor];

    提交动画

  [UIView commitAnimations];

 

    块动画 比较流行的动画方法 ,有很多细节可以去探讨,很多方法,属性可以去探索

    [UIView animateWithDuration :持续时间 delay:延迟时间 usingSpringWithDamping: 弹性 initialSpringVelocity:动画运行的速 options:动画运行的方式选项  animations:^{

         动画运行时执行的代码 

     } completion:^(BOOL finished) {

        动画完成后执行的代码

     }];

 

今天由于时间关系,就分享这么一个简单的动画在这里

 

posted @ 2016-04-12 00:32  蒙圈的小明  阅读(182)  评论(0编辑  收藏  举报