android:orientation - Set the Orientation on a Layout

How to Set the Orientation on a Layout

1. If you don't already have an Android project created, create an Android project.

2. Open the main.xml file.

3. If you'd like a vertical orientation, add the bolded line below.

<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
>

4. If you'd like a horizontal orientation, add the bolded line below.

<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
>

5. Compile and run

Resources: