1.重写InfoWindow的适配器方法
aMap.setInfoWindowAdapter(
new AMap.InfoWindowAdapter() {
@Override
public View getInfoWindow(
Marker marker) {
View infowindow =
LayoutInflater.
from(
DreamBlueMonitorActivity.
this)
.inflate(
R.layout.
inforwindow_layout,
null);//InfoWindow的的背景布局文件.
//重新设置InfoWindow里的数据.
TextView textView=(
TextView) infowindow.findViewById(
R.id.
tc);
textView.setText(
"船号:"+
shipNo);
return infowindow;
}
@Override
public View getInfoContents(
Marker marker) {
return null;
}
});
2.在背景布局文件里 要将infoWindow的背景图片作为Background设置在布局文件的最外层布局里.