title: Unable to Put ViewPager inside a ScrollVIew/NestedScrollView
body: <p>I have a ViewPager which resides inside a parent Linear Layout and below the ViewPager there are some buttons. The ViewPager was working great until recently I changed the parent from LinearLayout to a ScrollView. Now the ViewPager disappeared. Please don't mark it as spam or duplicate.</p>
  
  <p>Also, there are tons of apps on Playstore currently using this. See this app - <a href="https://play.google.com/store/apps/details?id=in.startv.hotstar" rel="nofollow noreferrer">link</a></p>
  
  <p><strong>What I Tried:</strong></p>
  
  <ol>
  <li>setFillViewport (true) - This didn't work for me.</li>
  <li>Set layout_height to 0dp</li>
  <li>Use a CustomScrollView</li>
  </ol>
  
  <p>All these doesn't help me. I am running the app on Android M.</p>
  
  <p>This is my layout.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v4.widget.NestedScrollView
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:fillViewport="true"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@color/black"
  tools:context=".activities.HomeActivity"&gt;
  
  &lt;LinearLayout
  android:orientation="vertical"
  android:layout_width="match_parent"
  android:layout_height="match_parent"&gt;
  
  &lt;android.support.v4.view.ViewPager
  android:id="@+id/pager"
  android:onClick="pagerClick"
  android:layout_width="match_parent"
  android:layout_height="0dp"
  android:layout_gravity="top"
  android:layout_weight="1"
  android:overScrollMode="never"/&gt;
  
  &lt;RelativeLayout
  android:layout_weight="0.8"
  android:layout_marginTop="30dp"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"&gt;
  .....two buttons
  &lt;/RelativeLayout&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;/android.support.v4.widget.NestedScrollView&gt;
  </code></pre>
  
  <p><strong>Question:</strong></p>
  
  <p>How can I achieve this? Also, is there an official way of doing it? </p>