zoukankan      html  css  js  c++  java
  • 2016.01.22 简单动画

    简单动画没什么好说的,直接看代码。=-=

    //横向、纵向移动
        [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);
        }];

      值得一提:『翻页效果』中的写法,别的都可以。

  • 相关阅读:
    关于yarn的spark配置属性
    spark1.2.0编译
    sqoop1.99.4 JAVA API操作
    数据库范式(1NF 2NF 3NF BCNF)
    HTTP协议详解【转载】
    ESI 动态缓存技术[转载]
    ESI+varnish页面片段缓存
    用 Gearman 分发 PHP 应用程序的工作负载【转载】
    介绍 JSON的
    跨多种环境部署 Gearman -改善应用程序性能和降低服务器负载
  • 原文地址:https://www.cnblogs.com/immustard/p/5158469.html
Copyright © 2011-2022 走看看