InfoWindowAdapters的问题

时间:2018-12-12 19:30:52

标签: android google-maps-api-2 mapactivity


这是我第一次尝试更改Marker的{​​{1}}。我的InfoWindow的布局存在一些问题:

  1. InfoWindow对我来说太大了。
    也许这是一个愚蠢的问题,但我无法调整大小。让我向您展示我的应用程序中的情况。

Here you are what I mean

  1. 无法显示我的自定义布局。
    我创建了一个自定义布局,在其中放置了InfoWindowProgressBarImageView。显示的唯一对象是Button。这是我的代码和屏幕截图:

    **** MAPSACTIVITY.JAVA ****

    Button

enter image description here

  1. 无法单击mappa.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() { // Use default InfoWindow frame @Override public View getInfoWindow(Marker arg0) { return null; } // Defines the contents of the InfoWindow @Override public View getInfoContents(Marker arg0) { View v = getLayoutInflater().inflate(R.layout.infowindow, null); LatLng latLng = arg0.getPosition(); ImageView imgNemico = (ImageView) v.findViewById(R.id.imgNemico); Button tvLng = (Button) v.findViewById(R.id.btnAttacco); ProgressBar pgbVita = (ProgressBar) v.findViewById(R.id.pgbVita); return v; } });
    假设以上所有内容都不会使该应用程序100%无用,则Button是不可点击的,因为如果我尝试这样做,则会触发整个Button。我不知道该怎么解决。

预先感谢您的耐心和考虑。

0 个答案:

没有答案