title: android ImageButton scale and maintain aspect ratio
body: <p>I have a screen that I'm trying to layout... </p>
  
  <p>Basically, I'm trying to evenly distribute 4 ImageButton objects vertically on a screen... I used this <a href="http://andmobidev.blogspot.com/2010/01/setting-width-of-view-using-percentage.html" rel="nofollow noreferrer">here</a> to evenly distribute the items, but now am having a terrible time getting the images to scale but maintain aspect ratio... if I use <code>scaleType="centerInside"</code> they don't scale, if I use "fitXY" they don't maintain aspect ratio... here is what the layout looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/QrbjS.png" alt="enter image description here"></p>
  
  <p>and here is the code:</p>
  
  <pre><code>    &lt;LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:layout_margin="0dp"
    android:padding="0dp"
    android:orientation="vertical"
    android:weightSum="5"
    &gt;
  
  
          &lt;ImageButton android:id="@+id/share_song" 
              android:layout_width="fill_parent" android:text=""
              android:layout_marginLeft="0dp"
              android:layout_marginTop="15dp"
              android:layout_marginRight="5dp"
              android:layout_marginBottom="5dp"
              android:gravity="left" 
              android:src="@drawable/share_song_button_sel"
              android:adjustViewBounds="true"
              android:background="#0000"
              android:scaleType="fitXY"
            android:layout_height="0dp"
            android:layout_weight="1"
              /&gt;
          &lt;Button 
              android:layout_width="wrap_content" 
              android:text="" android:id="@+id/tag_a_song"
              android:layout_marginLeft="5dp"
              android:layout_marginTop="10dp"
              android:layout_marginRight="0dp"
              android:layout_marginBottom="5dp"
              android:gravity="right" 
              android:layout_gravity="right"
              android:background="@drawable/song_check_in_button_sel"
            android:layout_height="0dp"
            android:layout_weight="1"
              /&gt;
          &lt;Button android:id="@+id/match_button" 
              android:layout_width="wrap_content" android:text=""
              android:layout_marginLeft="0dp"
              android:layout_marginTop="10dp"
              android:layout_marginRight="0dp"
              android:layout_marginBottom="5dp"
              android:gravity="left" 
              android:background="@drawable/music_match_button_sel"
            android:layout_height="0dp"
            android:layout_weight="1"
              /&gt;
          &lt;Button android:id="@+id/friends_button" 
              android:layout_width="wrap_content" android:text=""
              android:layout_marginLeft="0dp"
              android:layout_marginTop="10dp"
              android:layout_marginRight="0dp"
              android:layout_marginBottom="5dp"
              android:gravity="right" 
              android:layout_gravity="right"
              android:background="@drawable/my_friends_music_button_sel"
            android:layout_height="0dp"
            android:layout_weight="1"
              /&gt;
  
          &lt;LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="horizontal"
            android:layout_marginRight="0dp"
            android:layout_marginLeft="0dp"
            android:layout_marginTop="0dp"
            android:padding="0dp" 
            &gt;
          &lt;LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="65dp"
            android:orientation="horizontal"
            android:layout_marginRight="0dp"
            android:layout_marginLeft="0dp"
            android:layout_marginTop="0dp"
            android:padding="0dp" 
            android:layout_gravity="bottom"
            &gt;
          &lt;ImageView android:src="@drawable/trending_bar"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="top"
            android:layout_marginRight="0dp"
            android:layout_marginLeft="0dp"
            android:layout_marginTop="10dp"
            android:scaleType="fitXY"/&gt;
  
              &lt;/LinearLayout&gt;
          &lt;/LinearLayout&gt; 
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Hopefully someone can help.</p>