垂直布局 vertical
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="测试按钮1" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="测试按钮2" />
</LinearLayout>
![image image](https://img2018.cnblogs.com/blog/1747317/201911/1747317-20191101132545602-1025454672.png)
水平布局 horizontal
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
![image image](https://img2018.cnblogs.com/blog/1747317/201911/1747317-20191101132546468-1180991320.png)