如何在Android中删除Drawable图像中的黑色阴影?
Drawable d = new BitmapDrawable(bitmap);mapController.animateTo(geoPoint);
mapOverlay = new MapOverlay(d);
listOfOverlays = mapView.getOverlays();
// listOfOverlays.clear();
listOfOverlays.add(mapOverlay);
overlayitem = new OverlayItem(geoPoint, "", "");
mapOverlay.addOverlay(overlayitem);
listOfOverlays.add(mapOverlay);
mapView.invalidate();
答案 0 :(得分:0)
您必须继承Overlay
类并重写draw()
方法。像这样:
public class MyOverlay extends Overlay
{
.....
// obtain the BitMap of the image you want to draw on map
.....
@Override
public void draw(Canvas canvas, MapView mapView, boolean shadow)
{
.....
// draw the BitMap on the canvas
.....
super.draw(canvas, mapView, false);
}
}
阴影是使用OverlayItem
的默认行为。