笔者自定义的infoWindow效果如图
图中的infoWindow背景用的是图片,自定义infoWindow用到的主要方法如下
public View getInfoContents(Marker arg0) {
return null;
}
/**
* 监听自定义infowindow窗口的infowindow事件回调
*/
public View getInfoWindow(Marker marker) {
View infoWindow = getLayoutInflater(null).inflate(
R.layout.hk_activity_mapshowfragment_infowindow, null);
render(marker, infoWindow);
return infoWindow;
}
/**
* 自定义infowinfow窗口,将自定义的infoWindow和Marker关联起来
*/
public void render(Marker marker, View view) {
String title = marker.getTitle();
TextView titleUi = ((TextView) view.findViewById(R.id.title));
titleUi.setText(title);
String sn