我将如何使用 UIPinchGestureRecognizer 使用 Transform 来缩放 CALayer(基于现有的变换,图层的当前状态)?
- (IBAction)gesturePinch:(UIPinchGestureRecognizer *)sender
{
float scale = sender.scale;
scale = scale - previousScale;
previousScale = scale;
layer.transform = CATransform3DScale(square.transform, scale, scale, scale);
}
因为规模正在增加,所以它会很快变得很大或非常小。有什么建议么?