• 动画 很精辟的


    CAlaye的动画

     //创建CAlayer动画

         CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"bounds.size"];

        //设置初始大小

    [animation setFromValue:[NSValue valueWithCGSize:CGSizeMake(1.0, 1.0)]];

        //设置运行后的方法

    [animation setToValue:[NSValue  valueWithCGSize:manImageView.bounds.size]];

        //设置时常

    [animation  setDuration:1.2];

        //设子代理监听

        [animation setDelegate:self];

    [manImageView.layer  addAnimation:animation forKey:@"image-bounds.size"];

    //漂浮的动画

     CAKeyframeAnimation  *animation=[CAKeyframeAnimation animationWithKeyPath:@"position"];

        //设置view行动的轨迹

        NSArray *values=[NSArray arrayWithObjects:[NSValue valueWithCGPoint:CGPointMake(fx,fy)],

    [NSValue valueWithCGPoint:CGPointMake(fx1, fy1)],

    [NSValue valueWithCGPoint:CGPointMake(fx2, fy2)],

    [NSValue valueWithCGPoint:CGPointMake(fx3, fy3)],

    [NSValue valueWithCGPoint:CGPointMake(fx4, fy4)],nil];

    //获得点

    [animation setValues:values];

        //设置时常

    [animation setDuration:5.0];

        //设置代理监听

        [animation setDelegate:self];

    [manImageView.layer  addAnimation:animation forKey:@"img-position"];

    //渐变的动画

        CABasicAnimation * animation=[CABasicAnimation  animationWithKeyPath:@"opacity"];

        //设置透明度最小值

    [animation setFromValue:[NSNumber numberWithFloat:1.0]];

        //设置透明度最大值

        [animation setToValue:[NSNumber numberWithInt:0.0]];

        //播放速率

        [animation setDuration:3.0];

        //播放次数

    [animation setRepeatCount:3.0];

        //设置监听代理

        [animation setDelegate:self];

    [animation setAutoreverses:YES];//默认的是NO,即透明完毕后立马恢复,YES是延迟恢复

        [manImageView.layer  addAnimation:animation forKey:@"img-opacity"];

    //立方体的动画

     CATransition *animation = [CATransition animation];

             //动画名称

                animation.type =@"cube";

         //翻转方向

                animation.subtype = kCATransitionFromLeft;

          //时长

                [animation setDuration:2];

        //代理方法

                [animation setDelegate:self];

        //上一个动画播放完不移除,默认是YES移除

                animation.removedOnCompletion = NO;

                [_bView.layer addAnimation:animation forKey:@"docube"];

    //水波纹动画

    CATransition *animation = [CATransition animation];

                animation.type =@"rippleEffect";

                [animation setDuration:2];

                [animation setRepeatCount:1.0];

                [_bView.layer addAnimation:animation forKey:@"s rippleEffect"];

    //收缩效果

    CATransition *animation = [CATransition animation];

                animation.type =@"suckEffect";

                [animation setDuration:2];

                [animation setRepeatCount:1.0];

                [_bView.layer addAnimation:animation forKey:@"s suckEffect"];

    //向后翻转动画

    CATransition *animation = [CATransition animation];

                animation.type =@"oglFlip";

                [animation setDuration:2];

                [animation setRepeatCount:1.0];

                [_bView.layer addAnimation:animation forKey:@"s oglFlip"];

    //向上翻页的动画

    CATransition *animation = [CATransition animation];

                animation.type =@"pageCurl";

                [animation setDuration:2];

                [animation setRepeatCount:1.0];

                [_bView.layer addAnimation:animation forKey:@"s pageCurl"];

    跟上边效果相反的动画

    CATransition *animation = [CATransition animation];

                animation.type =@"pageUnCurl“;

                [animation setDuration:2];

                [animation setRepeatCount:1.0];

              

    [_bView.layer addAnimation:animation forKey:@"s pageUnCurl"];

    这些动画效果跟上边的用法一样

    新视图覆盖旧视图

    moveIn

    旧视图移出露出新视图

    reveal

    新视图把旧视图推出去

    push

    立方体向上滚动

    alignedCube

    相机动画

    cameraIris

    相机打开效果

    cameraIrisHollowOpen

    相机关闭效果

    cameraIrisHollowClose

    * 过渡方向
    fromRight;
    fromLeft;
    fromTop;
    fromBottom;

  • 相关阅读:
    redis集群报错,(error) MOVED 15495 127.0.0.1:7003
    在云服务器上时候,我关闭了防火墙还是不能连接!
    redis 集群安装 3主3从3台云主机
    ajax完成团队信息异步添加【实际项目】
    众创项目首页推荐需求
    添加删除表格(js完成)【自己实际项目】
    【JPA 级联保存/级联删除】@OneToMany (双向) 一对多【转】
    页面提交 string数组和list对象集合举例
    Form表单如何传递List数组对象到后台的解决办法(转)
    实现同时提交多个form(基础方法) 收集(转)
  • 原文地址:https://www.cnblogs.com/flyingdreaming/p/3881359.html
Copyright © 2020-2023  润新知