美文网首页
UIView的简单动画

UIView的简单动画

作者: Mustard_Buli | 来源:发表于2016-03-16 14:29 被阅读109次

这里的这个动画什么好说的,直接看代码:

//横向、纵向移动
    [UIView animateWithDuration:0.5 animations:^{
        self.aView.frame = CGRectMake(_aView.frame.origin.x, _aView.frame.origin.y + 50, _aView.frame.size.width, _aView.frame.size.height);
    }];
    
    //渐变效果
    [UIView animateWithDuration:0.5 animations:^{
        _aView.alpha = !_aView.alpha;
    }];
    
    //翻页效果
    [UIView beginAnimations:nil context:nil];//开始动画的配置
    [UIView setAnimationDuration:0.5];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];//动画的『节奏』
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:_aView cache:NO];
    [UIView commitAnimations];//动画配置完毕,提交动画
    
    //旋转
    [UIView animateWithDuration:0.5 animations:^{
        //只能做一次
//        _aView.transform = CGAffineTransformMakeRotation(M_PI);
        //能多次
        _aView.transform = CGAffineTransformRotate(_aView.transform, M_PI_4);
    }];
    
    //放大效果
    [UIView animateWithDuration:0.5 animations:^{
        _aView.transform = CGAffineTransformMakeScale(2, 2);
    }];
    
    //缩小
    [UIView animateWithDuration:0.5 animations:^{
        _aView.transform = CGAffineTransformScale(_aView.transform, 0.7, 0.7);
    }];

    //平移
    [UIView animateWithDuration:0.5 animations:^{
        _aView.transform = CGAffineTransformTranslate(_aView.transform, 10, 10);
    }];

相关文章

  • UIView动画失效问题

    UIView动画失效 我们一般在做简单动画时,可以用UIView 提供的[UIView animateWithDu...

  • 动画(一)

    简单的总结下自己学习动画的知识: 对于UIview的动画 [UIView animateWithDuration:...

  • iOS Core Animation - UIView Anim

    UIView Animation 简单动画 对于 UIView 上简单的动画,iOS 提供了很方便的函数: 第一个...

  • 几种常用UIView的简单动画(不涉及CA)

    简单的UIView的Block动画 首先来说一下这个UIView的Block动画,这个动画用着方便,还可以设置很多...

  • 动画

    简单动画:[UIView beginAnimations:nil context:nil];//开始动画[UIVi...

  • 动画案例:加入购物车

    UIView 动画 CALay 动画 UIView 动画: UIView 动画:UIView的属性动画 就是在一定...

  • UIView的简单动画

    这里的这个动画什么好说的,直接看代码:

  • ios UIView动画

    UIView简单的frame改变动画,代码如下:

  • iOS 动画

    UIView基础动画实现方式一 UIView位置大小动画UIView颜色动画UIView透明度动画 UIView基...

  • Swift-UIView动画

    iOS 中实现动画有好几种方式,UIView 是最简单的一种。UIView 层面的动画只是对 layer 层部分属...

网友评论

      本文标题:UIView的简单动画

      本文链接:https://www.haomeiwen.com/subject/uxiqlttx.html