首页 > 移动平台 > 详细

iOS开发之基本旋转动画

时间:2020-04-27 17:25:46      阅读:58      评论:0      收藏:0      [点我收藏+]

今天碰到个需要将图片一直旋转的需求,话不多说直接上代码

    CABasicAnimation *rotationAnimation;
    rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
    rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ];
    rotationAnimation.duration = 1;
    rotationAnimation.cumulative = YES;
    rotationAnimation.repeatCount = 10000;
    [_sendLoadingImageView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];

移除动画

[_sendLoadingImageView.layer removeAllAnimations];

 

iOS开发之基本旋转动画

原文:https://www.cnblogs.com/hecanlin/p/12788045.html

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