界面布局(Layout)是用户界面结构的描述,定义了全部的元素、结构和相互关系。android
通常声明Android程序界面布局有两种方法编辑器
线性布局(LinearLayout)中,全部的子元素都在垂直或水平方向按照顺序在界面上进行排列。每行(列)仅包含一个界面元素。布局
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > </LinearLayout>