首页 > 其他 > 详细

360 旋转

时间:2015-12-30 22:07:37      阅读:141      评论:0      收藏:0      [点我收藏+]

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

}

360 旋转

原文:http://www.cnblogs.com/Jenaral/p/5090049.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!