Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid listview less items fill screen
    primarykey
    data
    text
    <p>I've custom list view layout. The items in list are going to be 5 or more. If more than say, 5-10 items are there in list, it looks good.</p> <p>But if there are say only 5 items, then blank space appears below list on devices larger in height. This does not look good.</p> <p>following is my list row layout -</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="fill_parent" android:layout_height="wrap_content" android:background="#FFF" android:orientation="horizontal" android:padding="5dip" &gt; &lt;TextView android:id="@+id/txt_update_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:focusable="false" android:paddingLeft="10sp" android:text="title" android:textColor="#b73a3e" android:textStyle="bold" android:typeface="normal" /&gt; &lt;TextView android:id="@+id/txt_update_excerpt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/txt_update_title" android:layout_marginTop="1dip" android:focusable="false" android:paddingLeft="10sp" android:paddingRight="10dp" android:text="text" android:textColor="#343434" android:textSize="15dip" /&gt; &lt;TextView android:id="@+id/txt_uid" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginLeft="20dip" android:layout_toRightOf="@+id/txt_update_title" android:focusable="false" android:text="some" /&gt; &lt;ImageView android:id="@+id/arrow" android:layout_width="20dp" android:layout_height="20dp" android:layout_alignBottom="@+id/txt_uid" android:layout_alignRight="@+id/txt_update_excerpt" android:layout_centerInParent="true" android:scaleType="centerInside" android:paddingRight="5dp" android:src="@drawable/arrow" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>And listview -</p> <pre><code>&lt;LinearLayout android:layout_width="match_parent" android:layout_height="fill_parent" android:orientation="vertical" android:padding="10dp" &gt; &lt;TextView android:id="@+id/tag_line" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/tagline" android:textColor="#fff" /&gt; &lt;ListView android:id="@+id/list_updates" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_weight="1" android:cacheColorHint="#0000" android:divider="#00000000" android:dividerHeight="0px" android:overScrollMode="never" &gt; &lt;/ListView&gt; &lt;/LinearLayout&gt; </code></pre> <p>What I desire is, if height of device is larger then I want list to take complete height by scaling height of each row in way that it should display all items w/o scroll. If items are more then scroll should appear. How can I set this up?</p> <hr> <p><strong>Update</strong></p> <p>I can opt-in for a solution where I'd check how many items are going to be there in list before and if they are less than 5-6, I'd choose a different layout consisting of LinearLayout or something that would fill up the blank space. But I can't figure out the structure I need to choose for such <code>LinearLayout</code>. Should I choose 5-6 LinearLayout below one another or a single with iteration? </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