リストビューの下部にフッターとしてビューを追加したいのですが、上部に表示されます。非常に多くのアプローチを試しましたが、すべて無駄でした。
これは私のxmlです....リストビューを含み、フッターを含みます
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#EFEFEF"
android:padding="15dp" >
<ImageButton
android:id="@+id/btnDeleteUserInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="70dp"
android:background="@android:color/transparent"
android:src="@drawable/manage_product_frag_delete" />
<View
android:id="@+id/viewHorizontal"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/btnDeleteUserInfo"
android:layout_marginTop="5dp"
android:background="#000000" />
<ListView
android:id="@+id/lvUserInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/viewHorizontal"
android:divider="#000000"
android:dividerHeight="1dp" >
</ListView>
<include
android:id="@+id/footer"
android:layout_below="@+id/lvUserInfo"
layout="@layout/administration_add_user_view" />
</RelativeLayout>
これはコードです:
lvUserInfo = (ListView) layoutView.findViewById(R.id.lvUserInfo);
userInfoAdapter = new AdministrationUserInfoAdapter(getActivity());
lvUserInfo.setAdapter(userInfoAdapter);
userInfoAdapter.addData(fillDataset());
View footer=(View) layoutView.findViewById(R.id.footer);
lvUserInfo.addFooterView(footer, null,true);
助けてください..どこが欠けているのか本当にわかりません