have a TableLayout that has a bunch of row that look like this:
<TableRow android:id="@+id/ROW_CHOOSE_ANSWER_1">
<Button android:id="@+id/BUTTON_CHOOSE_ANSWER_1"
style="@style/cue_minor"
android:clickable="true"
android:cursorVisible="false"
android:layout_height="wrap_content"
android:layout_weight="45"
android:layout_width="1dip"
android:gravity="center|center_vertical"
/>
<Button android:id="@+id/BUTTON_CHOOSE_ANSWER_2"
style="@style/cue_minor"
android:clickable="true"
android:cursorVisible="false"
android:layout_height="wrap_content"
android:layout_weight="45"
android:layout_width="1dip"
android:gravity="center|center_vertical"
/>
</TableRow>
the current behavior is such that if the text of the first button wraps to the second line, the height of the button will be larger. this is good. however, the other button, if it does not have that much text will be smaller.
i would like to have both buttons have the same height --- which is the maximum height required by the button with the largest amount of text.
can i do this with layout tags or would i need 开发者_如何学编程to do this manually through code somehow?
Set android:minHeight="30dip";
or some value in both of them
just try giving the height as fill_parent
... Hope this will work....
精彩评论