1
I’m using 3 buttons on one Linear Layout
.
I would like to distribute the spaces between the buttons.
Follows the image as exexmplo:
xml screen:
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="texto1"
android:id="@+id/btn1"
android:onClick="botao1"
android:textSize="10dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="texto2"
android:id="@+id/btn2"
android:onClick="botao2"
android:textSize="10dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="texto3"
android:id="@+id/btn3"
android:onClick="botao3"
android:textSize="10dp" />
</LinearLayout>
you can give a hint, I added another row of buttons has how to give a small space between the top button with the bottom.
– Vale
If you duplicate the xml I posted to represent the new row it will be
15dp
below the first. Include the two in a Linearlayout.– ramaral
I made it a button top got stuck on the other bottom
– Vale
The Linearlayout has
android:layout_marginTop="15dp"
should soon be separated by15dp
– ramaral
was missing this code, it worked.
– Vale