google map v2 issue with uft8 string for title in android

微笑、不失礼 提交于 2019-12-23 05:29:36

问题


I'm developing an android project,in this project i have google map view and i use google map v2 . The problem is, i have some MarkerOption and i'm setting a utf8 string for them but the titles are shown as an empty string

here is my code for adding markers:

MarkerOptions marker = new MarkerOptions().position(pos).title("سلام");
marker.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE));
googleMap.addMarker(marker);

how can i solve this?

thanks for any helps


回答1:


you must set an English word then set your string :

MarkerOptions marker = new MarkerOptions().position(pos).title("TEST:"+"سلام");



回答2:


You can add a unicode left-to-right mark ("\u200e") to your text, like:

.title("\u200e" + "سلام");


来源:https://stackoverflow.com/questions/25137146/google-map-v2-issue-with-uft8-string-for-title-in-android

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