[英]MKMapView annotation image changes to pin on click
我在我的iphone mapview應用程序上單擊注解圖像,將其更改為pin。 誰能告訴我如何糾正它?
我的想法是顯示圖像而不是自定義圖釘,即使單擊它也是如此。
當您單擊注釋時,該委托將被稱為
- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
{
//I think here you will be adding a annotation(my assumption)
[mapView addAnnotation:yourAnnotation];
//This will call viewForAnnotation again
}
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
//If you didnt specify the a image for the annotation the default pin image will be assigned here..
}
如果我的假設是錯誤的,那么將您的代碼發布在此處相關的注釋中,這樣您就可以獲得更好的答案
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.