Skip to content Skip to sidebar Skip to footer

Linear Layout With Two Buttons Side By Side - Android

I have 3 buttons the layout.xml below where they appear below of each other...

Solution 1:

just change android:orientation="vertical" to android:orientation="horizontal" of your layout and every thing will work fine

Solution 2:

best way to do this is to make layout and then put your button like this code

<TableRowandroid:layout_width="wrap_content"android:layout_height="wrap_content"><Buttonandroid:id="@+id/Button9"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="left"android:text="@string/Home1"/><Buttonandroid:id="@+id/Button11"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="right"android:text="@string/NextL"/>

in this shape you have two button in same row so easy :D

Solution 3:

Change the Linear Layout orientation Vertical into Horizontal.And then Give weight for your both buttons as 1 or 2.As your wish.the buttons will be arranged equally.

Post a Comment for "Linear Layout With Two Buttons Side By Side - Android"