Note that there are some explanatory texts on larger screens.

plurals
  1. POSeparator (divider) after last item of ListView
    primarykey
    data
    text
    <p>When I create a simple layout with only a ListView in it, there is <strong>no separator displayed</strong> after the last item, which looks a bit ugly.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p><img src="https://i.stack.imgur.com/tfDDA.png" alt="enter image description here"></p> <p>However, I found out that a separator <strong>is displayed</strong> after the last item if I add another view bellow the listview and set the <code>android:layout_above</code> attribute for the listview.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;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" /&gt; &lt;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" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p><img src="https://i.stack.imgur.com/l1e3X.png" alt="enter image description here"></p> <p><strong>Why does the listview behave like this? How can I get a separator after the last item in a layout that contains only a listview?</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload