Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to increase ScrollView height in Android?
    text
    copied!<p><img src="https://i.stack.imgur.com/PaiPc.png" alt="alt text"> <br></p> <p>Hi friends,<br></p> <p>I am using <code>GridView</code> inside a <code>ScrollView</code> for displaying images. In the GridView I have 16 images which were dynamically added, but the <code>ScrollView</code> does not display all 16 images (see screenshot). </p> <p>I want the <code>ScrollView</code> to display the whole <code>GridView</code>, does anybody know how I can fix this?</p> <p>Thanks all.</p> <p><strong>xml file:</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;merge android:layout_width="wrap_content" android:layout_height="340dip" xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="320dip" android:orientation="vertical" android:background="@color/black"&gt; &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollview" android:layout_width="fill_parent" android:layout_height="500dip" android:background="#ffffff" android:paddingTop="10dip" android:paddingLeft="5dip" android:layout_weight="1"&gt; &lt;GridView android:id="@+id/jr_lookbook_grid" android:layout_width="fill_parent" android:layout_height="fill_parent" android:numColumns="4" android:verticalSpacing="10dp" android:horizontalSpacing="10dp" android:columnWidth="90dp" android:stretchMode="columnWidth" android:adjustViewBounds="true" android:background="@drawable/shape" android:gravity="center" android:layout_weight="1"/&gt; &lt;/ScrollView&gt; &lt;Button android:id="@+id/click" android:background="@android:color/transparent" android:text="Load More Pictures..." android:textColor="@color/white" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/LinearLayout02_img" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_gravity="center" android:layout_alignParentBottom="true" android:background="@color/black" android:layout_alignParentLeft="true"&gt; &lt;WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="none" /&gt; &lt;ImageView android:id="@+id/ImageView01" android:layout_gravity="center_horizontal" android:scaleType="centerInside" android:layout_width="wrap_content" android:layout_height="fill_parent" android:adjustViewBounds="true"&gt; &lt;/ImageView&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/LinearLayout02" android:background="#AA000000" android:layout_width="400px" android:layout_height="50dip" android:layout_gravity="bottom" &gt; &lt;Button android:id="@+id/back" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/back1" android:layout_alignParentRight="true" android:layout_marginLeft="10dip" /&gt; &lt;Button android:background="@drawable/forward5" android:id="@+id/next" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:layout_alignParentRight="true" android:layout_marginLeft="215dip" /&gt; &lt;/LinearLayout&gt; &lt;/merge&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