title: Android ImageButton -- can't get image in the center
body: <p>I want to create an Android ImageButton in the xml file with a background image, and a smaller icon on top of that, right in the center. For some reason, it's not obvious how to do it, and documentation is no help.</p>
  
  <pre><code>&lt;ImageButton
  android:id="@+id/sound_button"
  android:layout_x="430px"
  android:layout_y="219px"
  android:layout_width="48px"
  android:layout_height="48px"
  android:scaleType="center"
  android:src="@android:drawable/volumeicon"
  android:background="@drawable/clearbuttonup"
  /&gt;
  </code></pre>
  
  <p>However, no matter what I try (putting "<strong>wrap _ content</strong>" instead of <strong>absolute</strong> numbers on layout _ height and layout _ width, the icon remains in the top left corner of the button. If, however, I have no background image (i.e. a system default white button), the icon does go into the center. The button also goes into the top left corner when I use a color instead of an image for the background.</p>
  
  <p>Why does this happen, and how would I actually get the behavior I want-- that is, a background image with the icon in the center?</p>