双击并缩放google map ios

问题描述 投票:1回答:1

有两种委托方法可以更改地图区域:

- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated  
- (void)mapView:(MKMapView *)mapView regionWillChangeAnimated:(BOOL)animated  

我的问题是:是否可以通过双击或缩放来检测地图区域是否已更改?

ios google-maps zoom pinch
1个回答
0
投票
您可以使用手势识别器检测双击:

UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)]; recognizer.numberOfTapsRequired = 2; [self addGestureRecognizer:recognizer];

并使用UIPinchGestureRecognizer对捏缩放进行相同操作>
© www.soinside.com 2019 - 2024. All rights reserved.