下面的代碼是針對具有頁腳的ListView,我面臨的問題是ListView中的較低項正在獲取重疊的頁腳。 所以你可以提出任何解決方案(因爲我嘗試了很多,每種情況我都得到相同的重疊結果)或其他方式來做到這一點。提前致謝。爲了以防萬一,我還發布了頁腳的代碼。需要幫助添加頁腳到Android ListView,使其不與ListView的條目重疊
<LinearLayout android:id="@+id/homeParentLayout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView android:layout_height="wrap_content"
android:layout_width="fill_parent" android:id="@+id/listV_main"
android:listSelector="@android:color/transparent"/>
<include android:id="@+id/footer" android:layout_height="wrap_content"
layout="@layout/mymenu" android:layout_width="fill_parent"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true">
</include>
</RelativeLayout>
</LinearLayout>
代碼mymenu.xml
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_gravity="bottom">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:orientation="vertical">
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_horizontal">
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text=" "
android:gravity="center"/>
<ImageView
android:id="@+id/imgSetting"
android:src="@drawable/settings_gear_icon_256"
android:layout_width="60dip"
android:layout_height="60dip"
android:layout_marginLeft="10sp"
android:clickable="true"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text=" "
android:gravity="center"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text=" "
android:gravity="center"/>
<ImageView
android:id="@+id/imgLogin"
android:layout_width="60dip"
android:src="@drawable/login_lock_256"
android:clickable="true"
android:layout_height="60dip" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text=" "
android:gravity="center"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text=" "
android:gravity="center"/>
</TableRow>
</TableLayout>
</LinearLayout>
問題是您的scrollview的底部結束在頁腳的底部而不是頁腳的頂部?即,您是否希望scrollview存在於底部是頁腳頂部的框架中? – matt5784
是的,我的問題是,我的列表視圖的底部結束在頁腳的底部,而不是在頁腳的頂部。 – anonymous123