ヘッダーに 「Left Button」「Center Button」「Right Button」を配置した場合は以下のようにすればOK
こんな感じになります。(スクロールしても、ヘッダーの部分は固定です。)
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- >
- <LinearLayout
- android:id="@+id/header_menu"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- >
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Left Button"
- />
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Center Button"
- android:layout_weight="1"
- />
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Right Button"
- />
- </LinearLayout>
- <ListView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:id="@+id/ListViewSample"
- android:layout_below="@id/header_menu"
- >
- </ListView>
- </RelativeLayout>
フッターもつけたい場合は,
http://blog.maxaller.name/2010/05/attaching-a-sticky-headerfooter-to-an-android-listview/
を参考にするとよし。
0 コメント:
コメントを投稿