Android Google Maps V2 Title or Snippets Strings F

2019-07-09 04:46发布

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条回答
劫难
2楼-- · 2019-07-09 05:01

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.

查看更多
登录 后发表回答