1
我實現perfect answer的chose007,使InfoWindow通過Google Maps API2在我的應用程序中可點擊。唯一的問題是,我想讓InfoWindow透明(使其成爲泡沫狀)。我可以用非交互式的信息窗口使用樣式的包裝做到這一點:如何通過谷歌地圖API2實現Android交互式InfoWindow透明
gMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {
@Override
public View getInfoWindow(Marker marker) {
ContextThemeWrapper cw = new ContextThemeWrapper(
getApplicationContext(),R.style.TransparentDialog);
LayoutInflater inflater = (LayoutInflater) cw
.getSystemService(LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.map_bubble,
null);
return layout;
}
信息窗口顯示爲透明的,但它是不可能的設置窗口中的內容:
@Override
public View getInfoContents(Marker marker) {
// Setting up the infoWindow with current's marker info
TextView bubHd = (TextView) infoWindow.findViewById(R.id.bubble_hd);
bubHd.setText(places.get(placeId).getTitle());
.
.
.
它是沒有更多的交互性,因爲互動性也設置在getInfoContents
裏面,在我看來,如果getInfoWindow
返回非null
結果,則根本不會調用此方法。
有誰知道,如何讓Google地圖上的交互InfoWindow透明?