提交
This commit is contained in:
29
QXLive/Tabbar/TabbarCustomView/FLImageView.m
Executable file
29
QXLive/Tabbar/TabbarCustomView/FLImageView.m
Executable file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// FLImageView.m
|
||||
// SoundRiver
|
||||
//
|
||||
// Created by ln007 on 2019/4/27.
|
||||
//
|
||||
|
||||
#import "FLImageView.h"
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
@implementation FLImageView
|
||||
- (void)startRotating {
|
||||
if (!_rotateAnimation) {
|
||||
CABasicAnimation *rotateAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
|
||||
rotateAnimation.fromValue = [NSNumber numberWithFloat:0.0];
|
||||
rotateAnimation.toValue = [NSNumber numberWithFloat:M_PI * 2]; //旋转一周
|
||||
rotateAnimation.duration = 20.0; //旋转时间 20秒
|
||||
rotateAnimation.repeatCount = MAXFLOAT; //重复次数,这里使用最大次数
|
||||
_rotateAnimation = rotateAnimation;
|
||||
rotateAnimation.removedOnCompletion = NO;
|
||||
}
|
||||
[self.layer addAnimation:_rotateAnimation forKey:nil];
|
||||
}
|
||||
|
||||
- (void)stopRotating {
|
||||
[self.layer removeAllAnimations];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user