InfoWindow 如何自定义关闭按钮

2024-11-14 11:13:07
推荐回答(1个)
回答(1):

参照了下MarkerDamoActivity,写了两个布局文件custom_info_window 和custom_info_contents,然后构造了render()函数,也复写了Infowindowadapter接口,titile和snippet也有内容,可是点击marker还是没反应,是不是忘记了什么关键的步骤啊,实在是麻烦你了,多谢!下面是部分关键代码:

mWindow = getLayoutInflater().inflate(R.layout.custom_info_window null);
mContents = getLayoutInflater().inflate(R.layout.custom_info_contentsnull);

aMap.setInfoWindowAdapter(this);
aMap.setOnMarkerClickListener(this);

@Override
public View getInfoContents(Marker arg0) {
// TODO Auto-generated method stub
render(arg0 mContents);
return mContents;

}

@Override
public View getInfoWindow(Marker arg0) {
// TODO Auto-generated method stub
render(arg0 mWindow);
return mWindow;

}

@Override
public boolean onMarkerClick(Marker arg0) {
// TODO Auto-generated method stub
return false;
}