一句话 :
marker.setInfoWindowEnable(true);
或是自定义一个infowindow,注意布局根部要设置全透明。
1、自定义一个infowindow
public class InfoWinNoAdapter implements AMap.InfoWindowAdapter {
private Context mContext;
public InfoWinNoAdapter(Context mContext) {
this.mContext = mContext;
initView();
}
@Override
public View getInfoWindow(Marker marker) {
View view = initView();
return view;
}
@Override
public View getInfoContents(Marker marker) {
return null;
}
@NonNull
private View initView() {
View view = LayoutInflater.from(mContext).inflate(R.layout.view_task_infowindow_no, null);
return view;
}
}
2、infowindow 布局全透明
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/transparent"/>
3、设置给 amap
InfoWinNoAdapter infoWinAdapter = new InfoWinNoAdapter(mContext);
aMap.setInfoWindowAdapter(infoWinAdapter);
结束。。。