2011-02-25 52 views
3

致以熱烈的祝賀,自定義的MKAnnotation

我使用下面的代碼,在地圖上輕敲時,在iOS 顯示批註。

MKPointAnnotation *aAnnotationPoint = [[MKPointAnnotation alloc] init]; 

aAnnotationPoint.title = @"Virginia"; 
aAnnotationPoint.subtitle = @"This is a test code .this is a test code. This is a test codeThis is a test code .this is a test code. This is a test code"; 

// Add the annotationPoint to the map 
[myMapView addAnnotation:aAnnotationPoint]; 

的問題是,註釋沒有完全顯示文本 - 它砍下與...。這是結果:

enter image description here

...我已經尋找這種樣本在互聯網上,但沒有沒有運氣。我怎樣才能做到這一點?

回答

4

默認情況下,calloutMKPointAnnotation的大小與您在圖像中顯示的大小相同。由於副標題非常長,字幕文本沒有完全顯示。

解決此問題的方法是去找custom callouts from here。也嘗試從這裏獲得幫助wonderful tutorial其中UIBarButton和UIImageView被提供給pinView。

希望你明白了我的觀點。祝你好運!

+0

感謝您的回覆。使用以下鏈接,您提供了http://blog.asolutions.com/2010/09/building-custom-map-annotation-callouts-part-1/,我需要更改爲顯示多行文字?確保這適用於我的scenerio的理由... – user198725878 2011-02-25 05:28:34

相關問題