Buttons with equal heights.
Posted
by Rpond
on Stack Overflow
See other posts from Stack Overflow
or by Rpond
Published on 2010-05-20T00:24:33Z
Indexed on
2010/05/20
0:30 UTC
Read the original article
Hit count: 224
Linear layout below. This layout is aligned parent bottom in a Relative Layout. Problem is I want all buttons to have the same height. I have tried layout_gravity="fill" but that doesn't seem to work.
<LinearLayout android:id="@+id/button_layout"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:background="#FFFFFF"
android:layout_alignParentBottom="true">
<Button android:text="Send" android:id="@+id/send_button"
android:layout_weight="1" android:layout_gravity="fill"
android:layout_width="0dip" android:layout_height="wrap_content">
</Button>
<Button android:text="Report Missing Image" android:id="@+id/report_button"
android:layout_weight="1"
android:layout_width="0dip" android:layout_height="wrap_content">
</Button>
<Button android:text="Close" android:id="@+id/close_button"
android:layout_weight="1" android:layout_gravity="fill"
android:layout_width="0dip" android:layout_height="wrap_content">
</Button>
</LinearLayout>
© Stack Overflow or respective owner