MyAnnotation在iphone谷歌地图中查看多行文字 [英] MyAnnotation view multiple lines text in iphone google map

查看:105
本文介绍了MyAnnotation在iphone谷歌地图中查看多行文字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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];

我想在谷歌地图中显示字幕的多行文字。如果我给\ n打破该行,它会直接显示谷歌地图中的\ n。如何显示多行?

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?

谢谢。

推荐答案

默认样式仅支持标题和副标题。标题和副标题都不能包含换行符。如果没有子类化,则无法执行此操作。

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

要使用自定义视图,请查看Apple的示例代码:

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

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

这篇关于MyAnnotation在iphone谷歌地图中查看多行文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆