Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The reason you don't get a scrollbar is because your <code>ViewPager</code> (and <code>RelativeLayout</code>) has it's height set to <code>match_parent</code> instead of <code>wrap_content</code>. This causes it to match the dimensions of your <code>ScrollView</code>, which kind of defeats the purpose of the <code>ScrollView</code> in the first place.. The contents of your <code>ScrollView</code> should be higher/taller than your <code>ScrollView</code> itself.</p> <p>To conclude, you should set both your <code>RelativeLayout</code>'s height and your <code>ViewPager</code>'s height to <code>wrap_content</code>. Also, you didn't set the order/position in which you want <code>RelativeLayout</code>'s children to appear; you might want to change that (or use <code>LinearLayout</code> instead). Example:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="match_parent" android:fadeScrollbars="true" android:fillViewport="true" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/textView1" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/menu" /&gt; &lt;android.support.v4.view.ViewPager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="wrap_content" /&gt; &lt;/LinearLayout&gt; &lt;/ScrollView&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