Linear Layout with two buttons side by side - android

android, android-linearlayout

Solution

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

Problem

I have 3 buttons the layout.xml below where they appear below of each other... ``` <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="10dip" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"> <Button android:id="@+id/btn_1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Car" /> <Button android:id="@+id/btn_2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Vehicle" /> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <Button android:id="@+id/btn_3" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Bike" /> </LinearLayout> </LinearLayout> ``` I would like to have the first two buttons side by side (btn_1 and btn_2). Could anybody give me a hint about how to do that??? Thanks a lot

Original source

Related problems