MyAnnotation view multiple lines text in iphone google map

浪尽此生 提交于 2019-12-02 21:29:58

问题


MKCoordinateRegion region1; 
    region1.center.latitude = 50.366772;
    region1.center.longitude = 20.010607;
    region1.span.longitudeDelta = 0.01f;
    region1.span.latitudeDelta = 0.01f;     


    MyAnnotation *ann1 = [[MyAnnotation alloc] init];
    ann1.title = @"Text1";
    ann1.subtitle = @"Text2\n, Text3\n, Text4\n";   
    ann1.coordinate = region1.center;
    [mapView addAnnotation:ann1];

I want to show the multiple line text for subtitle in google map.If i give the \n to break the line,it display directly the \n in google map.How can i show the multilple lines?

Thanks.


回答1:


The default style only supports the title and subtitle. Neither title nor subtitle can include line breaks. You cannot do this without subclassing.

To use a custom view review Apple's sample code:

http://developer.apple.com/library/ios/#samplecode/WeatherMap/Introduction/Intro.html



来源:https://stackoverflow.com/questions/3888085/myannotation-view-multiple-lines-text-in-iphone-google-map

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!