In my screen I am having 3 buttons and in next row below those buttons I am having 3 names (name corresponding to those buttons) but my problem is that when ever name changes then size of buttons also changes but I do want to fix the size of buttons here is my code please help me
<TableLayout android:background="@drawable/toptab"
android:layout_width="fill_parent" android:id="@+id/tableLayout"
android:layout_height="wrap_content"
android:stretchColumns="1" android:gravity="center_vertical"
android:layout_alignParentBottom="true">
<TableRow>
<ImageButton android:id="@+id/btnPrev" android:background="@drawable/imgPrev"
android:layout_marginLeft="5dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<ImageButton android:id="@+id/btnRefresh"
android:layout_gravity="center" android:background="@drawable/refreshbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ImageButton android:id="@+id/btnNext"
android:background="@drawable/imgNext"
android:layout_width="5dp"
android:layout_height="20dp"
android:layout_marginRight="5dp" />
</TableRow>
<TableRow >
<TextView android:id="@+id/prev" android:text="Hk" android:layout_marginLeft="5dp" />
<TextView android:id="@+id/refresh" android:text="Refresh" android:layout_gravity="center" />
<TextView android:id="@+id/next" android:text="RS" android:layout_marginRight="5dp" />
</TableRow>
</TableLayout>
If you want to avoid fixing button size, then I would recommend using different layout than
TableLayout, maybeRelativeLayoutandTextViewswith propertyalignBaselineorLinearLayoutwithweightproperties could do the trick.