1

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

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

我的问题是:有没有办法检测地图区域是否从双击或缩放中改变?

4

1 回答 1

0

您可以使用手势识别器来检测双击:

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

并为捏缩放做同样的事情,用UIPinchGestureRecognizer

于 2012-08-27T09:13:17.257 回答