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

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

 

相关文章:

  • 2021-07-06
  • 2022-12-23
  • 2021-11-13
  • 2021-08-29
  • 2021-11-29
  • 2021-10-06
  • 2022-02-17
猜你喜欢
  • 2022-12-23
  • 2021-09-04
  • 2021-12-07
  • 2022-12-23
  • 2022-02-08
  • 2021-06-20
  • 2022-12-23
相关资源
相似解决方案