アクティビティの一部であるリストビューがあります。ユーザーがリストビューのアイテムを一括削除することを選択できるようにしたいので、メニューから対応するオプションを選択すると、すべてのリストアイテムの横にチェックボックスが表示されます。ユーザーがチェックボックスをクリックすると、ボタンバーが下から上にスライドし(Gmailアプリのように)、削除ボタンをクリックすると選択したアイテムが削除されますが、バーのキャンセルボタンをクリックするとすべてのチェック済みアイテムのチェックが外れます。
これは私のページ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>
これまでのところ、チェックボックスを選択すると下部のバーが表示され、リストの最後の要素と重なることを除いて、すべてが機能しています。他のすべてのリストアイテムは上にスクロールできますが、リストの最後のアイテムを上にスクロールすることはできないため、ユーザーは意図した場合にそのアイテムを選択できません。これがオーバーラップのスクリーンショットです。
リストビューフッターオプションを使用してみましたが、画面の下部に固定されたままではなく、リストの最後にバーが追加されます。オーバーラップが発生しないようにリストビューを十分に「上げる」方法はありますか?ところで、私はすでにリストビュー自体に下マージンを追加するか、ボタンバーを表示する直前にリストビューをラップするLinearLayoutを追加しようとしましたが、1つのチェックボックスをクリックするとリストビューの別のチェックボックスがチェックされるなどの他のバグが発生します。