1

嗨,我对 android 谷歌地图上的 infowindow 有疑问。

 @Override
        public View getInfoWindow(Marker arg0) {
            return null;
        }

喜欢这张照片 带有菜单的信息窗口

我想制作一个带有其他菜单的信息窗口。当我点击方向然后谷歌地图将显示,如果我点击另一个文本将显示另一个活动。我知道那张来自 goole map javascript 的图片

 @Override
        public View getInfoWindow(Marker arg0) {
            return null;
        }
4

1 回答 1

2

这是做不到的。

从文档

The info window that is drawn is not a live view. The view is rendered as an image (using View.draw(Canvas)) at the time it is returned. This means that any subsequent changes to the view will not be reflected by the info window on the map. To update the info window later (for example, after an image has loaded), call showInfoWindow(). Furthermore, the info window will not respect any of the interactivity typical for a normal view such as touch or gesture events. However you can listen to a generic click event on the whole info window as described in the section below.

所以窗口不是一个活动视图,只是一个图像,你能做的最好的就是在点击信息窗口时显示一个对话框

于 2013-10-09T15:31:34.823 回答