Android Create Layered drawable in XML

Posted by Lyubomyr Dutko on Stack Overflow See other posts from Stack Overflow or by Lyubomyr Dutko
Published on 2009-08-15T13:25:36Z Indexed on 2010/03/09 11:36 UTC
Read the original article Hit count: 440

Filed under:
|
|

Hello,

I would like to create a drawable in XML that should include:

  1. image drawable
  2. color drawable

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.

© Stack Overflow or respective owner

Related posts about android

Related posts about custom