界面佈局(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>