1
如何使用UIPinchGestureRecognizer通過變換(基於現有變換,圖層的當前狀態)來縮放CALayer?使用UIPinchGestureRecognizer來縮放圖層
- (IBAction)gesturePinch:(UIPinchGestureRecognizer *)sender
{
float scale = sender.scale;
scale = scale - previousScale;
previousScale = scale;
layer.transform = CATransform3DScale(square.transform, scale, scale, scale);
}
因爲規模在增加,所以規模很大或很小。有什麼建議麼?