Reputation: 4526
I would like to create a drawable in XML that should include:
The color drawable provides white transparent color. So, as a result we would have image with some white transparent layer on top.
I have tried to use LayerDrawable, but it fails to be created during application launch:
<LayerDrawable xmlns:android="http://schemas.android.com/apk/res/android">
<BitmapDrawable android:src="@drawable/button_play" />
<ColorDrawable android:color="#80FFFFFF"/>
</LayerDrawable>
Could you please advice what is wrong here?
Thanks.
Upvotes: 3
Views: 4205
Reputation: 1007544
Per the Android documentation for LayerDrawable:
It can be defined in an XML file with the <layer-list> element. Each Drawable in the layer is defined in a nested <item>.
Upvotes: 4