2011-02-25 66 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

相关问题