Android Google Maps V2 Title or Snippets Strings From HTML

人盡茶涼 提交于 2019-12-10 22:17:53

问题


Hi i'm working on a google maps v2 project on Android and i need to write a bit HTML code (like a page) and implement it to google marker's title or snippet.

I know there are ways like : http://wptrafficanalyzer.in/blog/customizing-infowindow-contents-in-google-map-android-api-v2-using-infowindowadapter/ here but i need to write HTML codes because after this work i will use these codes again in another mobile project.

Any help would be appreciated, thanks


回答1:


According to this page, you are able to customize the content and design of info windows.
If this is so, then you could define a custom layout with few TextViews, which then is very easy to set html text in it:

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

Also, you may want to take a look and browse these example projects on how to use Map V2 in various ways.



来源:https://stackoverflow.com/questions/17381988/android-google-maps-v2-title-or-snippets-strings-from-html

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