Mã sau đây chính xác pinch/thu phóng chế độ xem vùng chứa, nhưng chỉ sau khi nó nhảy đến tỷ lệ 1.0. Làm cách nào tôi có thể sửa đổi nó để chế độ xem vùng chứa có quy mô từ tỷ lệ hiện tại của nó?ios - Chụm/thu phóng từ tỷ lệ hiện tại
UIPinchGestureRecognizer *twoFingerPinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(twoFingerPinch:)];
[self.container addGestureRecognizer:twoFingerPinch];
- (void)twoFingerPinch:(UIPinchGestureRecognizer *)recognizer
{
_scale = recognizer.scale;
CGAffineTransform tr = CGAffineTransformScale(self.view.transform, _scale, _scale);
self.container.transform = tr;
}
bạn đã giải quyết vấn đề của bạn ? Nếu có thì vui lòng chia sẻ mã. – Manthan