zoukankan      html  css  js  c++  java
  • 视图抖动动画

    // 视图抖动动画

    + (void)shakeView:(UIView *)view duration:(CGFloat)fDuration
    {
        if (view && (fDuration >= 0.1f))
        {
            CABasicAnimation* shake = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
            //设置抖动幅度
            shake.fromValue = [NSNumber numberWithFloat:-0.3];
            shake.toValue = [NSNumber numberWithFloat:+0.3];
            shake.duration = 0.1f;
            shake.repeatCount = fDuration/4/0.1f;
            shake.autoreverses = YES;
            [view.layer addAnimation:shake forKey:@"shakeView"];
        }else{}
    }
  • 相关阅读:
    【题解】B进制星球
    高斯消元
    7.16
    题解 P1572 【计算分数】
    7.30
    7.31
    项目中使用 MyBatis(一)
    从整体上了解Spring MVC
    Spring注解
    Spring IOC 和 DI
  • 原文地址:https://www.cnblogs.com/ranger-jlu/p/3877704.html
Copyright © 2011-2022 走看看