zoukankan      html  css  js  c++  java
  • iOS图片立体旋转

    图片做动画效果

    //动画开始

    -(void)startAnimationMsg

    {

        num = 0;

        self.timer = [NSTimer timerWithTimeInterval:0.4 target:self selector:@selector(updateAnimationMsg) userInfo:nil repeats:YES];

        [[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSDefaultRunLoopMode];

        /*

        CABasicAnimation* rotationAnimation;

        rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.y"];

        rotationAnimation.toValue = [NSNumber numberWithFloat: -M_PI * 2.0 ];

        rotationAnimation.duration = 2;

        rotationAnimation.cumulative = YES;

        rotationAnimation.repeatCount = 0;

        [self.OpenImageView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];

        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{

            [self startAnimation];

        });

         */

    }

    -(void)updateAnimationMsg

    {

        switch (num) {

            case 0:

                self.OpenImageView.image = [UIImage imageNamed:@"img_open-02.png"];

                num ++;

                break;

            case 1:

                self.OpenImageView.image = [UIImage imageNamed:@"img_open-03.png"];

                num++;

                break;

            case 2:

                self.OpenImageView.image = [UIImage imageNamed:@"img_open-01.png"];

                num = 0;

                break;

            default:

                break;

        }

    }

    //动画结束

    -(void)endAnimationMsg

    {

         self.OpenImageView.image = [UIImage imageNamed:@"img_open-01.png"];

        [self.timer invalidate];

    }

     

  • 相关阅读:
    Linux下端口被占用确认
    Debuggex – 超好用的正则表达式可视化调试工具
    URL最大长度
    无需重启 修改计算机名直接生效
    UDP穿越NAT原理(p2p)
    gdb中信号
    锁 (读写锁优先级 写饥饿) (锁竞争引发的高系统调用)
    Loopback接口用途---用作管理地址。
    C/C++调试:gdbserver的简单使用
    总结一下NDK crash排查步骤
  • 原文地址:https://www.cnblogs.com/huzi213/p/7238224.html
Copyright © 2011-2022 走看看