ListView のみを含む単純なレイアウトを作成すると、最後の項目の後にセパレーターが表示されず、少し見苦しくなります。
<?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" >
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" />
</RelativeLayout>
しかし、リストビューの下に別のビューを追加し、リストビューの属性を設定すると、最後の項目の後にセパレーターが表示されることがわかりました。android:layout_above
<?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" >
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/bottom"
android:layout_alignParentTop="true" />
<TextView
android:id="@+id/bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@android:color/holo_blue_dark"
android:text="Bottom" />
</RelativeLayout>
リストビューがこのように動作するのはなぜですか? リストビューのみを含むレイアウトの最後の項目の後にセパレータを取得するにはどうすればよいですか?