Simple Ask
Is it possible to evenly distribute buttons across the width of an android RELATIVE LAYOUT?
<RelativeLayout android:layout_height="wrap_content" android:layout_width="fill_parent"
android:id="@+id/menu" android:layout_alignParentBottom="true">
<Button android:layout_height="30dp" android:layout_width="wrap_content"
android:text="aaaaaaa" android:id="@+id/aaaa"
android:layout_alignParentLeft="true"></Button>
<Button android:layout_height="30dp" android:layout_width="wrap_content"
android:text="bbbbbbb" android:id="@+id/bbbbb"
android:layout_centerHorizontal="true" android:textStyle="bold"></Button>
<Button android:layout_height="30dp" android:layout_width="wrap_content"
android:text="cccccccc" android:id="@+id/cccccc"
android:layout_alignParentRight="true" android:textStyle="bold"></Button>
How about throwing a LinearLayout inside your RelativeLayout, and adding the Buttons inside the LinearLayout (all of the buttons should have the same layout_weight).
The only way that I know of is to put them in a LinearLayout
and set the weight.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With