天天看點

Android:線性布局(LinearFrame)例子

修改layout中xml為

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="@drawable/background"
 >
 <Button 
     android:text="按鈕 1" 
     android:id="@+id/button1"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     />
  <Button 
     android:text="按鈕 2" 
     android:id="@+id/button2"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     />
   <Button 
     android:text="按鈕 3" 
     android:id="@+id/button3"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     />
    <Button 
     android:text="按鈕 4" 
     android:id="@+id/button4"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     />
 

</LinearLayout>