是否可以阻止 UIPinchGestureRecognizer缩小原始帧? 我知道这可以通过使用UIScrollView轻松完成,但在这种情况下这是不可能的。
我目前正在使用它来转换视图;
UIView *piece = gestureRecognizer.view;
CGPoint locationInView = [gestureRecognizer locationInView:piece];
CGPoint locationInSuperview = [gestureRecognizer locationInView:piece.superview];
[gestureRecognizer view].transform = CGAffineTransformScale([[gestureRecognizer view] transform], [gestureRecognizer scale], [gestureRecognizer scale]);
piece.layer.anchorPoint = CGPointMake(locationInView.x / piece.bounds.size.width, locationInView.y / piece.bounds.size.height);
piece.center = locationInSuperview;
答案 0 :(得分:1)
缩小时缩放属性将小于1,放大时缩放大于1,因此只需在识别器触发时检查缩放,并且不要缩放视图以获得小于1的手势缩放。 / p>