zoukankan      html  css  js  c++  java
  • 360 旋转

    - (void)rotateSpinningView

    {

        [UIView animateWithDuration:1.5 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{

            self.imageView.transform = CGAffineTransformRotate(self.imageView.transform, M_PI);

        } completion:^(BOOL finished) {

            [self rotateSpinningView];

        }];

    }

     

    - (void) runSpinAnimationOnView:(UIView*)view duration:(CGFloat)duration rotations:(CGFloat)rotations repeat:(float)repeat;

    {

        CABasicAnimation* rotationAnimation;

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

        rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 /* full rotation*/ * rotations * duration ];

        rotationAnimation.duration = duration;

        rotationAnimation.cumulative = YES;

        rotationAnimation.repeatCount = repeat;

        

        [view.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];

    }

  • 相关阅读:
    JavaScript总结(一)
    序列化函数
    random与os,sys模块
    认识模块
    时间模块
    日志处理
    异常处理
    类的约束
    反射
    区分函数以及方法
  • 原文地址:https://www.cnblogs.com/Jenaral/p/5090049.html
Copyright © 2011-2022 走看看