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];

    }

     

  • 相关阅读:
    python实战===短信验证码的小项目
    pillow模块的学习
    安全测试===8大前端安全问题(下)
    安全测试===8大前端安全问题(上)
    移动端测试===Android内存泄露和GC机制(转)
    识别验证码
    网址
    自动化测试===Macaca环境搭建,自我总结
    linux===Ubuntu修改设备名称
    macaca安装失败的解决办法!
  • 原文地址:https://www.cnblogs.com/huzi213/p/7238224.html
Copyright © 2011-2022 走看看