title: How to assign a flexible size to the image button?
body: <p>I want to create image buttons with a flexible size so that they can fit in any android device without problems, that's the code I'm using:</p>
  
  <pre><code> &lt;GridLayout
          android:id="@+id/grid1"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_centerInParent="true"
          android:layout_marginTop="150dp"
          android:background="@drawable/corneres"
          android:columnCount="1"
          android:orientation="vertical" &gt;
  
          &lt;ImageButton
              android:id="@+id/imageButton1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:src="@drawable/homeview"
              android:scaleType="centerInside"
              android:adjustViewBounds="true" /&gt;
  
          &lt;ImageButton
              android:id="@+id/imageButton3"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_column="0"
              android:layout_gravity="right|top"
              android:layout_row="0"
              android:src="@drawable/profiles"         
              android:scaleType="centerInside"
              android:adjustViewBounds="true"/&gt;
  
          &lt;ImageButton
              android:id="@+id/imageButton2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_column="0"
              android:layout_gravity="center"
              android:layout_row="0"
              android:src="@drawable/ac" 
              android:scaleType="centerInside"
              android:adjustViewBounds="true"/&gt;
  
            .
            .
            .
  
      &lt;/GridLayout&gt;
  </code></pre>
  
  <p><strong>and <a href="http://imgur.com/HO9gERI" rel="nofollow">that</a> is the output i got from some device.</strong></p>