2017-02-13 2 views
0

Ich brauche diese bauen:Wie kann ich eine transparente Form mit farbigem Hintergrund

The white must be transparent(not blue)

die weiße muss transparent sein

, wenn ich diese Form verwenden:

<shape xmlns:android="http://schemas.android.com/apk/res/android" 
android:shape="rectangle" 
> 
<size android:height="32dp" 
    android:width="16dp"/> 
<solid android:color="@android:color/transparent" 
    /> 
<corners android:topLeftRadius="16dp" 
    android:bottomLeftRadius="16dp" 
/> 

innerhalb von

<ImageView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/yyy" 
    android:background="@color/colorPrimary"/> 

ich ein blaues Rechteck (weil die Farbe unter der transparenten Form blau ist)

Wie kann ich die Form transparent zu bekommen, so dass ich die Farbe hinter dem Image sehen?

+0

können Sie nicht regelmäßig png verwenden 'Bitmap'? – pskink

+0

haha, ja !! das war so einfach, tnx –

Antwort

0

schreiben Code in Ihre Farbe:

<color name="transparent">#10000000</color> 

und verwenden auch <solid android:color="@color/transparent">

Verwandte Themen