私はアクティビティの一部であるリストビューを持っています。私はユーザがリストビュー内の項目を一括して削除する選択をしたいので、メニューから対応するオプションを選択すると、すべてのリスト項目の横にチェックボックスが表示されます。ユーザーが任意のチェックボックスをクリックすると、ボタンバーが下から上に移動し(gmailアプリケーションのように)、削除ボタンをクリックすると選択したアイテムが削除されますが、バーのキャンセルボタンをクリックするとチェックされたアイテムはすべてオフになります。ボトムボタンバーはListviewの最後の要素と重なっています!
これは私のページlayout.xmlです:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:id="@+id/list_area"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
>
<ListView
android:id="@+id/mylist"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:drawSelectorOnTop="false"
android:layout_weight="1"
/>
<TextView
android:id="@+id/empty_list_message"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:layout_gravity="center_vertical|center_horizontal"
android:text="@string/msg_for_emptyschd"
android:layout_margin="14dip"
android:layout_weight="1"
/>
</LinearLayout>
<RelativeLayout
android:id="@+id/bottom_action_bar"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/schedule_bottom_actionbar_border"
android:layout_marginBottom="2dip"
android:layout_gravity="bottom"
android:visibility="gone"
>
<Button
android:id="@+id/delete_selecteditems_button"
android:text="Deleted Selected"
android:layout_width="140dip"
android:layout_height="40dip"
android:layout_alignParentLeft="true"
android:layout_marginLeft="3dip"
android:layout_marginTop="3dip"
/>
<Button
android:id="@+id/cancel_button"
android:text="Cancel"
android:layout_width="140dip"
android:layout_height="40dip"
android:layout_alignParentRight="true"
android:layout_marginRight="3dip"
android:layout_marginTop="3dip"
/>
</RelativeLayout>
</FrameLayout>
</LinearLayout>
はこれまでのところ、私は下のバーは、チェックボックスの選択時に表示されたときに、それはリストの最後の要素と重なることを除いて作業のすべてを持っています。他のすべてのリスト項目をスクロールすることはできますが、リストの最後の項目を上にスクロールすることはできません。そのため、ユーザーはその項目を選択することはできません。ここにはscreenshot of the overlapがあります。
私はlistviewフッターオプションを使用しようとしましたが、バーが画面の下に固定されずにリストの末尾に追加されます。オーバーラップが起こらないようにリストビューを十分に「引き上げる」方法がありますか? 私はすでにリストビュー自体にボトムマージンを追加しようとしましたが、ボタンバーを表示する前にリストビューをラップするLinearLayoutがありましたが、リストビューのチェックボックスをクリックするなど、
RelativeLayoutを、ListViewを保持するLinearLayoutと同じ重さのLinearLayoutに置き換えるとどうなりますか? – James