例如,我想显示地图矩形的当前x,y,宽度和高度,但是我不知道应该处理什么事件。至少我要捕捉双击,缩放和拖动。

最佳答案

查看MKMapViewDelegate协议的文档。您有以下可用方法:http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKMapViewDelegate_Protocol/MKMapViewDelegate/MKMapViewDelegate.html

– mapView:regionWillChangeAnimated:
– mapView:regionDidChangeAnimated:
– mapViewWillStartLoadingMap:
– mapViewDidFinishLoadingMap:
– mapViewDidFailLoadingMap:withError:
– mapViewWillStartLocatingUser:
– mapViewDidStopLocatingUser:
– mapView:didUpdateUserLocation:
– mapView:didFailToLocateUserWithError:
– mapView:viewForAnnotation:
– mapView:didAddAnnotationViews:
– mapView:annotationView:calloutAccessoryControlTapped:
– mapView:annotationView:didChangeDragState:fromOldState:
– mapView:didSelectAnnotationView:
– mapView:didDeselectAnnotationView:
– mapView:viewForOverlay:
– mapView:didAddOverlayViews:


另外,MKMapView继承自UIScrollView,因此通过将自己设置为委托,您还可以采用UIScrollViewDelegate协议,并使用以下方法:http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html

08-26 09:05