Difference between getInfoWindow() and getInfoContents() in Googlemaps v2 for Android

风流意气都作罢 提交于 2019-12-03 16:20:57

问题


Two questions:

  1. Whats the difference between public abstract View getInfoWindow (Marker marker) and public abstract View getInfoContents (Marker marker) .

  2. What is the use of getInfoContents() .

Google map blog says:(getInfoWindow()) allows you to provide a view that will be used for the entire info window. (getInfoContents()) allows you to just customize the contents of the window but still keep the default info window frame and background. . can any one please expalin(try to compare with an existing item, may be like listView row item or so )

Thanks


回答1:


In the above screenshot, I have used an InfoWindowAdapter, where I overrode getInfoContents(). My getInfoContents() method returned the icon and text that you see. My getInfoContents() did not provide the rectangular bubble that the icon and text is in. Also, my getInfoContents() did not provide the caret at the bottom of that bubble that points at the marker, the slight drop shadow behind the bubble, etc.

So, you use getInfoContents() if you want that rectangular bubble, caret, drop shadow, etc. If you do not, and you want to provide the complete info window visual representation, use getInfoWindow().



来源:https://stackoverflow.com/questions/17253019/difference-between-getinfowindow-and-getinfocontents-in-googlemaps-v2-for-an

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