我想在当前位置的标注中显示 2 行标签。 MKUserLocation 而不是 MKAnnotation 有人可以帮忙吗?
我确信可以使用自定义标注。但不确定如何为 MKUserLocation 创建它。
最佳答案
在 viewForAnnotation
方法中,您可以尝试以下操作:
- (MKAnnotationView *)map:(MKMapView *)map viewForAnnotation:(id <MKAnnotation>) annotation{
if(self._mapView.userLocation==annotation){
self._mapView.userLocation.title=@"some text";
self._mapView.userLocation.subtitle=@"some text";
return nil;
}
}
希望这有帮助。
关于iphone - 当前位置的自定义标注,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8179827/