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

    }

  • 相关阅读:
    Python的文本数据
    Python
    正则表达式
    多数据库的链接
    工作感受月记 201902月
    女儿的出生
    工作感受月记 201901月
    工作感受月记 201812月
    工作感受月记 201811月
    工作感受月记 201809
  • 原文地址:https://www.cnblogs.com/Jenaral/p/5090049.html
Copyright © 2011-2022 走看看