Android 台灣中文網

標題: 如何將Layout固定在下方 [打印本頁]

作者: ploglin    時間: 2011-10-25 09:22
標題: 如何將Layout固定在下方
本帖最後由 ploglin 於 2011-10-25 09:27 編輯

看到主題,我相信有決大部份的人都以為我要說明的是 RelateLayout 或 FrameLayout 的應用,但是我說要說明的是另一種應用方式,希望還不知道的人也可以一起學習。

先讓大家看下程式碼
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout
  3.   xmlns:android="http://schemas.android.com/apk/res/android"
  4.   android:orientation="vertical"
  5.   android:layout_width="match_parent"
  6.   android:layout_height="match_parent">
  7.     <ListView android:id="@+id/listView1" android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_weight="1"></ListView>
  8.     <ImageView android:id="@+id/imageView1" android:layout_height="wrap_content" android:layout_width="match_parent" android:src="@drawable/banner"></ImageView>
  9.    
  10. </LinearLayout>
複製代碼
所呈現出來的畫面如下
未命名.PNG
登錄/註冊後可看大圖