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:
<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" >
<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" />
<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"/>
<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"/>
.
.
.
</GridLayout>
and that is the output i got from some device.