【问题标题】:Android Google Maps V2 Title or Snippets Strings From HTML来自 HTML 的 Android Google Maps V2 标题或片段字符串
【发布时间】:2013-12-10 15:27:52
【问题描述】:

您好,我正在 Android 上开发一个谷歌地图 v2 项目,我需要编写一些 HTML 代码(如页面)并将其实现到谷歌标记的标题或 sn-p。

我知道有这样的方法:http://wptrafficanalyzer.in/blog/customizing-infowindow-contents-in-google-map-android-api-v2-using-infowindowadapter/ 这里但我需要编写 HTML 代码,因为在这项工作之后我将在另一个移动项目中再次使用这些代码。

任何帮助将不胜感激,谢谢

【问题讨论】:

    标签: android google-maps google-maps-markers google-maps-android-api-2


    【解决方案1】:

    According to this page,您可以自定义信息窗口的内容和设计。
    如果是这样,那么您可以定义一个带有少量 TextViews 的自定义布局,然后在其中设置 html 文本非常容易:

    Spanned spannedContent = Html.fromHtml(htmlString);
    textView.setText(spannedContent, BufferType.SPANNABLE);
    

    另外,您可能想看看并browse these example projects 了解如何以各种方式使用 Map V2。

    【讨论】:

    • 谢谢你的回复,我忘记了。
    猜你喜欢
    • 1970-01-01
    • 2013-03-29
    • 2014-06-06
    • 2012-11-28
    • 1970-01-01
    • 2014-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多