在我的应用程序中启用显示当前位置的‘蓝点’
mapView.showsUserLocation = YES禁用/隐藏点
mapView.showsUserLocation = NO为了丢下一根大头针。到目前一切尚好。
在'userLocation‘处添加一个注解别针,并在地图中将其拖动到一个新位置。在此之后,我想通过再次将showsUserLocation设置为YES来再次显示蓝点-但它根本不显示!可能的问题是什么?有没有办法强制它再次显示(重置userLocation?)有没有其他方法?涉及哪些事件?
感谢你在这件事上的帮助..
发布于 2010-12-28 18:29:30
检查您是否正在使用- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation方法try自定义annotationView:
if (annotation==_mapView.userLocation ) {
return nil;
}
else {
//...
//costumizing pins for other annotations on mapview
//return customized annotationview
}发布于 2012-03-22 01:41:54
试试这个:
if ([annotation isKindOfClass:[MKUserLocation class]]) return nil;使用类而不是annotation==_mapView.userLocation意味着您停止使用_mapView.userLocation或其他任何东西,这一行不会中断。
https://stackoverflow.com/questions/3625874
复制相似问题