Android高德地图如何修改InfoWindow的背景图片.
生活随笔
收集整理的這篇文章主要介紹了
Android高德地图如何修改InfoWindow的背景图片.
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
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的的背景布局文件. //重新設(shè)置InfoWindow里的數(shù)據(jù).TextView textView=(TextView) infowindow.findViewById(R.id.tc);textView.setText("船號(hào):"+shipNo);return infowindow;}@Override public View getInfoContents(Marker marker) {return null;} });
2.在背景布局文件里 ? 要將infoWindow的背景圖片作為Background設(shè)置在布局文件的最外層布局里.
總結(jié)
以上是生活随笔為你收集整理的Android高德地图如何修改InfoWindow的背景图片.的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 阿里妈妈展示广告预估校准技术演进之路
- 下一篇: android sina oauth2.