從RelativeLayout
開始,比在RelativeLayout
中添加所有項目,最後將頭文件放在xml的底部(在底部,它將顯示所有其他元素)。例如。是這樣的:
<!-- Root element -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- First text view, the margin_top defines space for your header -->
<TextView android:id="@+id/tv1" android:layout_margin_top="height_of_your_header"/>
<!-- TextView below another view -->
<TextView android:id="@+id/tv2" android:layout_below="@+id/tv1" />
<!-- Your Header file, which will be positioned over all elements
- When closed, it will fit above @id/tv1
- When opened, it will float above the other elements -->
<include
layout="@layout/header"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
你想說什麼..澄清它。 – Unknown 2013-04-05 06:16:15
增加了更多文字,我希望它更清晰。 – 2013-04-05 06:20:58
不清楚enuff。 – Hasham 2013-04-05 06:24:01