title: Button scales to background image instead of content
body: <p>What I need to do is have the background image just fill up the natural size of the button, as when no background is specified and the default grey background image is shown. But instead, my button scales up to the size of the background image rather than the text. </p>
  
  <p>There was a previous <a href="https://stackoverflow.com/questions/4761800/scale-background-image-to-wrap-content-of-layout">question</a>, but nobody had a solution. </p>
  
  <p>The button: </p>
  
  <p><img src="https://i.stack.imgur.com/3oEhG.png" alt="enter image description here"></p>
  
  <pre><code>&lt;Button
      android:id="@+id/morebtn"
      style="@style/CustomButton"
      android:text="More" /&gt;
  </code></pre>
  
  <p>I have this custom button style (greybutton is a 9-patch): </p>
  
  
  
  <pre><code>&lt;resources&gt;
      &lt;style name="CustomButton" parent="@android:style/TextAppearance"&gt;
          &lt;item name="android:textColor"&gt;#FFFFFF&lt;/item&gt;
          &lt;item name="android:layout_marginLeft"&gt;10dip&lt;/item&gt;
          &lt;item name="android:layout_marginRight"&gt;10dip&lt;/item&gt;
          &lt;item name="android:layout_marginBottom"&gt;10dip&lt;/item&gt;
          &lt;item name="android:layout_width"&gt;wrap_content&lt;/item&gt;
          &lt;item name="android:layout_height"&gt;wrap_content&lt;/item&gt;
          &lt;item name="android:layout_centerInParent"&gt;true&lt;/item&gt;
          &lt;item name="android:background"&gt;@drawable/greybutton&lt;/item&gt;
          &lt;item name="android:textSize"&gt;20sp&lt;/item&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>Right now it fills up the screen widthwise, despite being told to wrap_content. When I remove <em>android:background</em> from the Button style, the button shrinks down to wrap the text as expected. </p>
  
  <p>Does anyone see why my background image isn't behaving like the default Button background? </p>