Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I use two listview in a layout?
    text
    copied!<p>There is a layout as follows. Two listView and on their headers with image and text. There are buttons at the bottom. My problem is, If the first listview is to height, other listview and buttons does not appear. I wanted to make a scrollview that contains the headers and the ListViews, but did not work. How can I do? Thanks</p> <pre><code> &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" &gt; &lt;ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="5dp" android:src="@drawable/icon" /&gt; &lt;LinearLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textStyle="bold" android:layout_marginLeft="5dp" android:text="@string/Dep" android:textColor="@color/white" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; &lt;ListView android:id="@+id/listView1" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;/ListView&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/Orange" android:gravity="center" &gt; &lt;ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="5dp" android:src="@drawable/icon2" /&gt; &lt;LinearLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textStyle="bold" android:textSize="18sp" android:layout_marginLeft="5dp" android:textColor="@color/white" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; &lt;ListView android:id="@+id/listView2" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;/ListView&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center" android:layout_margin="10dp" &gt; &lt;Button android:id="@+id/btn1" android:layout_width="0dp" android:layout_height="55dp" android:layout_margin="5dp" android:layout_weight=".3" android:gravity="bottom|center_horizontal" android:textSize="16sp" android:textStyle="bold" /&gt; &lt;Button android:id="@+id/btn2" android:layout_width="0dp" android:layout_height="55dp" android:layout_margin="5dp" android:layout_weight=".7" android:text="@string/Continue" android:textColor="@color/white" android:textSize="24sp" android:textStyle="bold" /&gt; &lt;/LinearLayout&gt; </code></pre>
 

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