2011-02-11 48 views
0

我的iPhone地圖查看應用程序,當我點擊註釋圖像時,它變成銷。任何人都可以請告訴我如何糾正它?MKMapView註釋圖像更改爲針點擊

我的想法是顯示一個圖像,而不是自定義引腳,即使它被點擊。

回答

1

當您在註釋此委託將被稱爲

- (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.. 
} 

單擊如果我的假設是錯誤的,那麼在這裏發表您的代碼相關的註釋,這樣你就可以得到更好的答案

+0

如何調用的MapView viewforannotaion方法在iphone中的按鈕點擊方法 – Rocky 2011-05-20 06:43:10