Wrap_content to the biggest?

have a TableLayout that has a bunch of rows 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 that if the text of the first button wraps in the second line, the height of the button will be greater. it's good. however, the other button, if it does not have much text, will be smaller.

I would like both buttons to have the same height --- this is the maximum height required by the button with the most text.

Can I do this using layout tags or will I need to do this manually using code?

+3
source share
2 answers

Set android:minHeight="30dip";or some value in both of them

+1
source

try giving height as fill_parent... I hope this works ....

0

All Articles