Android 台灣中文網
標題: 如何將Layout固定在下方 [打印本頁]
作者: ploglin 時間: 2011-10-25 09:22
標題: 如何將Layout固定在下方
本帖最後由 ploglin 於 2011-10-25 09:27 編輯
看到主題,我相信有決大部份的人都以為我要說明的是 RelateLayout 或 FrameLayout 的應用,但是我說要說明的是另一種應用方式,希望還不知道的人也可以一起學習。
先讓大家看下程式碼- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <ListView android:id="@+id/listView1" android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_weight="1"></ListView>
- <ImageView android:id="@+id/imageView1" android:layout_height="wrap_content" android:layout_width="match_parent" android:src="@drawable/banner"></ImageView>
-
- </LinearLayout>
複製代碼 所呈現出來的畫面如下