0
如何在当前位置旋转CALayer?如何在当前位置旋转CALayer?
如何在当前位置旋转CALayer?如何在当前位置旋转CALayer?
我使用非常相似的代码,它正在旋转。
我将弧度赋值为float并且缺少视图的赋值以显示图层。
- (void)spinLayer:(CALayer*)layer { // Create a new spinning animation CAAnimation* spinningAnimation = [self animationForSpinning]; // Assign this animation to the provided layer's opacity attribute. // Any subsequent change to the layer's opacity will // trigger the animation. [layer addAnimation:spinningAnimation forKey:@"opacity"]; // So let's trigger it now layer.opacity = 0.99; [self.contentView.layer addSublayer:layer]; }