How to make an button background be composed of two images on Android?
<p>I am looking to have a button's background be composed of a backround image, with another image overlayed on top. I do not need the button to have any text.</p>

<p>I have tried the following approach:</p>

<pre><code>&lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:background="@drawable/button_background" /&gt;
</code></pre>

<p><strong>button_background.xml</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;item&gt;
    &lt;bitmap android:src="@drawable/background_image" android:gravity="center"&gt;&lt;/bitmap&gt;
  &lt;/item&gt;
  &lt;item&gt;
    &lt;bitmap android:src="@drawable/foreground_image" android:gravity="center"&gt;&lt;/bitmap&gt;
  &lt;/item&gt;
&lt;/layer-list&gt;
</code></pre>

<p>However, when I do this, the foreground image is stretched to the size of the background image, even though I am specifying gravity to center.</p>
