Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A possible solution is to add a View (a layout with a textView or ImageView) beneath your ListView:</p> <pre><code>&lt;ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" &gt; &lt;/ListView&gt; &lt;LinearLayout android:id="@+id/viewid" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="0" /&gt; </code></pre> <p>The weights are important to show both components. After that, implements the listView's onScrollListener. </p> <pre><code>setOnScrollListener(new OnScrollListener() { @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { //get the showed item num, and if its equal to total, you can hide the view //get a reference to your viewid viewid.setVisibility(View.GONE); } @Override public void onScrollStateChanged(AbsListView view, int scrollState) { } }); </code></pre> <p>When it reaches the last line, setVisibility(View.GONE) for the bottom View. If you want to show this View again, when user scrolls up, modify the code. Of course, you can use aother layout, a textView, or something else.</p> <p><strong>UPDATE</strong></p> <p>I played with the a layout a little bit, and there is an other solution for your layout file, where the bottom View is overlaying the listView, so the removing of this textView is smooth.</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;ListView android:id="@+id/listView1" android:layout_width="match_parent" android:layout_height="wrap_content" &gt; &lt;/ListView&gt; &lt;TextView android:id="@+id/textView1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:padding="5dp" android:background="#ffffff" android:layout_alignParentBottom="true" android:text="..." /&gt; &lt;/RelativeLayout&gt; </code></pre>
    singulars
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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