因此,当在 GoogleMap (v2) 上的 Groundoverlay 中使用此位图描述符时,透明度显示为黑色,谁能解释为什么?
半径圆形状文件
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<gradient android:startColor="@color/brand_color" android:endColor="@android:color/transparent" android:type="radial" android:gradientRadius="110"/>
</shape>
放置在地图上
if (mDotMarkerBitmap==null){
int px = getResources().getDimensionPixelSize(R.dimen.pin_radius_drawable);
mDotMarkerBitmap = Bitmap.createBitmap(px, px, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(mDotMarkerBitmap);
Drawable shape = getResources().getDrawable(R.drawable.radius_circle);
shape.setBounds(0, 0, mDotMarkerBitmap.getWidth(), mDotMarkerBitmap.getHeight());
shape.draw(canvas);
}
BitmapDescriptor descriptor = BitmapDescriptorFactory.fromBitmap(mDotMarkerBitmap);
GroundOverlay groundOverlay = mMap.addGroundOverlay(new GroundOverlayOptions()
.image(descriptor)
.transparency(0.4F)
.position(center, radiusDistance.distanceInMeters*2));
我似乎无法理解为什么这是畸形的我只是希望它从内到外淡出,但是它正在从颜色淡入灰色(黑色但透明)