zoukankan      html  css  js  c++  java
  • 类似长按图标抖动一样

    #define RADIANS(degrees) ((degrees * M_PI) / 180.0)

        CGAffineTransform leftWobble = CGAffineTransformRotate(CGAffineTransformIdentity, RADIANS(-1.0));

        CGAffineTransform rightWobble = CGAffineTransformRotate(CGAffineTransformIdentity, RADIANS(1.0));

        self.view.transform = leftWobble;

        [UIView beginAnimations:@"wobble" context:self.view];

        [UIView setAnimationRepeatAutoreverses:YES];

        [UIView setAnimationRepeatCount:10];

        [UIView setAnimationDuration:0.08];

        [UIView setAnimationDelegate:self];

        [UIView setAnimationDidStopSelector:@selector(wobbleEnded:finished:context:)];

        self.view.transform = rightWobble;

        [UIView commitAnimations];

    - (void) wobbleEnded:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {

        if ([finished boolValue])

        {

            UIView* item = (UIView *)context;

            item.transform = CGAffineTransformIdentity;

        }

    }

  • 相关阅读:
    poj 1286
    poj 1815
    poj 3368
    十个利用矩阵乘法解决的经典题目
    poj 1026
    hdu 1394
    poj 3270
    poj 2154
    《重构 改善既有代码的设计》读书笔记2
    Android OpenGL ES: 渐变颜色的三角形
  • 原文地址:https://www.cnblogs.com/ligun123/p/2217280.html
Copyright © 2011-2022 走看看