title: Android - Image button size
body: <p>My imagebutton code wont respond to "fill_parent" and "wrap_content".
  Instead, it just shows the middle of the image (because it is a pretty big image).
  I tried setting specific values for the image but it still didn't work! Can somebody help me?</p>
  
  <p>My button.xml in the res/drawable folder:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;\
  &lt;item android:state_pressed="true" 
  android:drawable="@drawable/largishbutton" /&gt; &lt;!-- pressed --&gt;
  &lt;item android:state_focused="true" 
  android:drawable="@drawable/largerbutton2" /&gt; &lt;!-- focused --&gt;
  &lt;item android:drawable="@drawable/largerbutton" /&gt; &lt;!-- default --&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>My main.xml in the res/layout folder:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent" 
   android:layout_height="fill_parent"
   android:background="@android:color/white"&gt;
   &lt;ImageButton
   android:src="@drawable/button"
   android:layout_height="fill_parent"
   android:layout_width="wrap_content"
    /&gt; 
   &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I tried using a LinearLayout, but the app wouldnt run, and I tried replacing the imagebutton with an imageview, but then the button didn't work.</p>