从XML形状透明的Andr​​oid BitMapDesc​​riptor是黑色的形状、透明、黑色、XML

由网友(七个字的文艺:曾經年少ヾ薄荷涼)分享简介:因此​​,对的GoogleMap(V2)在地面叠加使用时,这个bitmapdescriptor透明度被显示为黑色的任何人都可以解释,为什么?So this bitmapdescriptor when used in a Groundoverlay on GoogleMap (v2) the transparency...

因此​​,对的GoogleMap(V2)在地面叠加使用时,这个bitmapdescriptor透明度被显示为黑色的任何人都可以解释,为什么?

So this bitmapdescriptor when used in a Groundoverlay on GoogleMap (v2) the transparency is being shown as black can anyone explain why?

半径圆形文件

   <?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));

我似乎无法理解为什么这是正在畸形我只是希望它从内到了淡出,但它是从褪色为灰色(黑色透明而)

I can't seem to understand why this is being malformed I just want it to fade out from inner to out, however it is fading from color to grey (black but transparent)

推荐答案

嗯确定的答案似乎是设置结束颜色为透明硬,而不是依靠

Hmmm ok the answer seemed to be to set the end color to a hard transparency rather than relying on

android:endColor="@android:color/transparent" 

我改变了高档彩色这种

I changed the end color to this

android:endColor="#00FFFFFF"
阅读全文

相关推荐

最新文章