[英]Disable all user interaction for MKMapView except for a given MKAnnotationView
我的地图上有一个MKMapView和一些MKAnnotationViews。
当某个事件发生时,我想在我的MKMapView上禁用用户交互,但在我的MKAnnotationView上保留交互。
理想情况下,它会
self.mapView.userInteraction = NO;
self.myAnnotationView.userInteraction = YES;
印花
[self.mapView recursiveDescription]
我发现我的注释视图嵌套在MKNewAnnotationContainerView中,它在Apple的类引用上没有公开的属性。
有任何想法吗?
在mapView上,将scrollEnabled
, zoomEnabled
, pitchEnabled
和rotateEnabled
为NO
并将userInteractionEnabled
保留为YES
。
这样,仍将启用注释视图。
对于pitchEnabled
和rotateEnabled
,您可能希望在设置它们之前检查这些属性是否存在(例如,检查地图视图respondsToSelector:@selector(setPitchEnabled)
等),因为它们是在iOS 7中添加的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.