- (void)rotateView { CABasicAnimation *rotationAnimation; rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; rotationAnimation.toValue = [NSNumber numberWithFloat:M_PI_4]; rotationAnimation.duration = 0.3; rotationAnimation.removedOnCompletion = NO; rotationAnimation.fillMode = kCAFillModeForwards; [self.workItem.icomImgView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"]; } removedOnCompletion 动画完毕是否移除,默认是YES; fillMode的作用就是决定当前对象过了非active时间段的行为. 比如动画开始之前,动画结束之后 kCAFillModeRemoved 这个是默认值,也就是说当动画开始前和动画结束后,动画对layer都没有影响,动画结束后,layer会恢复到之前的状态