title: How to add shadow using a drawable behind solid color shape in xml?
body: <p>I have a .png image which is a circular shape and is just a shadow. What I have is an <code>ImageButton</code> which has an image for its <code>android:src</code> property. For its background I can have an xml file in drawable file. What I want now is to have the shadow image which is a png to go behind another solid shape -&gt; android:shape=&quot;oval&quot;.</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;layer-list xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
  
      &lt;item android:drawable=&quot;@drawable/shadowimg&quot; /&gt;
  
      &lt;item&gt;
          &lt;shape android:shape=&quot;oval&quot;&gt;
  
              &lt;solid
                  android:color=&quot;#d63a33&quot;/&gt;
  
              &lt;size
                  android:width=&quot;70dp&quot;
                  android:height=&quot;70dp&quot;/&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  &lt;/layer-list&gt;
  </code></pre>
  <p>As you see in the code I am adding an item with the shadow image with the <code>android:drawable</code> property. However this does not let the shadow show. It simply shows the red circle shape. But I want the shadow image behind the solid red circle shape. From my tiny knowledge of layer-list the top item goes in the back and the one on bottom comes first.</p>
  <p>UPDATE: After moving the image shadow to bottom I got the effect however the size of the solid red circle shape is too big and changing the size doesn't change the size.</p>
  <p>UPDATED Code:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;layer-list xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
  
      &lt;item&gt;
          &lt;shape android:shape=&quot;oval&quot;&gt;
  
              &lt;solid
                  android:color=&quot;#d63a33&quot;/&gt;
  
              &lt;size
                  android:width=&quot;5dp&quot;
                  android:height=&quot;5dp&quot;/&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
      &lt;item android:drawable=&quot;@drawable/shadowimg&quot; /&gt;
  &lt;/layer-list&gt;
  </code></pre>
  <p>**** UPDATE 2: ****
  I noticed when I remove <code>&lt;item android:drawable=&quot;@drawable/shadowimg&quot; /&gt;</code> I can change size of solid circle shape but when I add this it defaults to a bigger size.</p>
  <p>This is what happens:</p>
  <p><img src="https://i.stack.imgur.com/8GHSF.png" alt="enter image description here" /></p>
  <p>Here's the shadow image if anyone needs:</p>
  <p><img src="https://i.stack.imgur.com/82gMy.png" alt="enter image description here" /></p>