我在我的应用程序的 UIView 中添加了一个 CALayer:
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:0.35];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
animation.type = @"pageCurl";
animation.fillMode = kCAFillModeForwards;
animation.endProgress = 0.58;
[animation setRemovedOnCompletion:NO];
[[self.view layer] addAnimation:animation forKey:@"pageCurlAnimation"];
现在,当用户旋转设备时,图层始终保持在屏幕上的相同位置(与主屏幕按钮对齐)。是否可以旋转动画/图层?我试过
self.view.layer.transform = CGAffineTransformMakeRotation (angle);
但这段代码只是旋转 UIView 而不是我设置的动画/图层。