• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help Imagebutton is not being Streched properly in Auto Cell size

Image is not being stretched properly in table layout.

The Auto Cell Height is hiding much part of image.


How to fit imagebutton size to cell size?

This is my Coding
i have 52 cells and imagebuttons with following style and format but put 5 here only


<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="rtl">

<TableRow
android:layoutDirection="rtl"
android:layout_weight="1"
>

<ImageButton
android:id="@+id/button1"
android:layout_width="75dip"
android:layout_height="65dip"
android:layout_column="1"
android:layout_weight="1"
android:adjustViewBounds="true"
android:background="@drawable/a1"




/>

<ImageButton
android:id="@+id/button2"
android:layout_width="75dip"
android:layout_height="65dip"
android:layout_column="2"
android:layout_weight="1"
android:adjustViewBounds="true"
android:background="@drawable/a2"
/>

<ImageButton
android:id="@+id/button3"
android:layout_width="75dip"
android:layout_height="65dip"
android:layout_column="3"
android:layout_weight="1"
android:adjustViewBounds="true"
android:background="@drawable/a3"
/>

<ImageButton
android:id="@+id/buttona4"
android:layout_width="75dip"
android:layout_height="65dip"
android:layout_column="4"
android:layout_weight="1"
android:adjustViewBounds="true"
android:background="@drawable/a4"
/>

<ImageButton
android:id="@+id/button5"
android:layout_width="75dip"
android:layout_height="65dip"
android:layout_column="5"
android:layout_weight="1"
android:adjustViewBounds="true"
android:background="@drawable/a5"
/>




</TableRow>
 
Back
Top Bottom