我已經設置,以便我的MKMapView顯示當前位置。我還爲其他引腳實現了一個定製引腳。然而,事實證明,當前位置顯示爲自定義引腳,而我只是希望它是一個普通的藍色圓圈(就像谷歌地圖所具有的一樣)。MKMapView顯示爲自定義引腳的當前位置
我已經定義在我的代碼如下:
- (MKAnnotationView *) mapView: (MKMapView *) mapView viewForAnnotation: (id<MKAnnotation>) annotation MKAnnotationView *pin = (MKAnnotationView *) [self.mapView dequeueReusableAnnotationViewWithIdentifier: @"VoteSpotPin"];
if (pin == nil)
{
pin = [[[MKAnnotationView alloc] initWithAnnotation: annotation reuseIdentifier: @"TestPin"] autorelease];
}
else
{
pin.annotation = annotation;
}
[pin setImage:[UIImage imageNamed:@"TestPin.png"]];
pin.canShowCallout = YES;
pin.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
return pin;
}
如何防止當前位置顯示爲一針?
mapView.showsUserLocation = YES,那麼它會顯示。如果你想顯示在目前的定位銷的當前位置緯度經度傳遞給註解當前位置; – Srinivas
我做到了這一點,它顯示了當前位置作爲一個自定義引腳,而不是藍色圓圈。這實際上是真正的問題 – adit
你有沒有檢查你的應用程序是否支持位置manager.issue在設備或模擬器 – Srinivas