title: ScrollView not working in LinearLayout
body: <p>I am trying to place a linearLayout inside a ScrollView but it isn't working.</p>
  
  <p>Here is my code,</p>
  
  <pre><code>   &lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  
  &lt;ScrollView
  xmlns:android="http://schemas.android.com/apk/res/android"
  
  android:layout_width="match_parent"
  android:scrollbars="vertical"
  android:background="@color/listChild"
  android:layout_height="match_parent"&gt;
  
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:paddingTop="40dp"
      android:paddingLeft="20dp"
      android:paddingRight="20dp"
      android:layout_gravity="center_horizontal"
      android:id="@+id/content_layout"&gt;
  
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="@color/white"
          android:weightSum="5"
          android:gravity="center"&gt;
  
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:orientation="vertical"
              android:layout_weight="1"
              android:layout_height="wrap_content"
              android:gravity="center"
              android:padding="5dp"&gt;
  
  
          &lt;ImageView
              android:layout_width="40dp"
              android:layout_height="40dp"
              android:src="@mipmap/ic_launcher"
              android:id="@+id/alphabet_icon"
              android:layout_weight="1" /&gt;
  
  
          &lt;/LinearLayout&gt;
  
  
          &lt;TextView
              android:text="TextView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/word_text"
              android:layout_weight="3"
              android:gravity="center" /&gt;
  
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:orientation="vertical"
              android:layout_weight="1"
              android:layout_height="wrap_content"
              android:gravity="center"
              android:padding="5dp"&gt;
  
              &lt;ImageView
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:src="@drawable/share_button"
                  android:id="@+id/share_button"
                  android:layout_weight="1"
                  android:layout_marginTop="5dp"
                  android:layout_marginBottom="5dp" /&gt;
  
              &lt;ImageView
              android:layout_width="match_parent"
              android:src="@drawable/save_new_icon"
              android:layout_weight="1"
              android:id="@+id/save_button"
              android:layout_marginTop="5dp"
              android:layout_marginBottom="5dp"
              android:layout_height="match_parent" /&gt;
  
  
          &lt;/LinearLayout&gt;
  
  
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@color/white"
          android:layout_marginTop="20dp"
          android:weightSum="5"
          android:gravity="center"
          android:orientation="vertical"&gt;
  
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:orientation="horizontal"
              android:weightSum="5"
              android:layout_height="wrap_content"&gt;
  
  
          &lt;TextView
              android:text="Pronunciation"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:layout_marginBottom="30dp"
              android:layout_marginTop="10dp"
              android:layout_marginLeft="10dp" /&gt;
  
  
              &lt;ImageView
                  android:src="@drawable/speak_icon_2"
                  android:layout_weight="4"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:id="@+id/speak_button"
                  android:scaleType="fitCenter" /&gt;
  
  
          &lt;/LinearLayout&gt;
  
  
          &lt;TextView
              android:text="TextView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="3"
              android:padding="10dp"
              android:id="@+id/pronounciation_text" /&gt;
  
  
  
  
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@color/white"
          android:layout_marginTop="20dp"
          android:weightSum="5"
          android:gravity="center"
          android:orientation="vertical"&gt;
  
  
          &lt;TextView
              android:text="Type of Word"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:id="@+id/textView4"
              android:layout_weight="3"
              android:layout_marginBottom="30dp"
              android:layout_marginTop="10dp"
              android:layout_marginLeft="10dp" /&gt;
  
          &lt;TextView
              android:text="type"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="3"
              android:padding="10dp"
              android:id="@+id/type_text" /&gt;
  
  
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="@color/white"
          android:layout_marginTop="20dp"
          android:weightSum="5"
          android:gravity="center"
          android:orientation="vertical"&gt;
  
  
          &lt;TextView
              android:text="Hindi Meaning"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_weight="3"
              android:layout_marginBottom="30dp"
              android:layout_marginTop="10dp"
              android:layout_marginLeft="10dp" /&gt;
  
          &lt;TextView
              android:text="textview"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="3"
              android:padding="10dp"
              android:id="@+id/hindi_text" /&gt;
  
  
      &lt;/LinearLayout&gt;
  
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="@color/white"
          android:layout_marginTop="20dp"
          android:weightSum="5"
          android:gravity="center"
          android:orientation="vertical"&gt;
  
  
          &lt;TextView
              android:text="English Meaning"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:id="@+id/textView5"
              android:layout_weight="3"
              android:layout_marginBottom="30dp"
              android:layout_marginTop="10dp"
              android:layout_marginLeft="10dp" /&gt;
  
          &lt;TextView
              android:text="TextView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="3"
              android:padding="10dp"
              android:id="@+id/english_meaning" /&gt;
  
  
      &lt;/LinearLayout&gt;
  
  
  
  &lt;/LinearLayout&gt;
  
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>Also, i am using this layout in a fragment in viewPager. And the problem is that the layout is not scrolling. </p>
  
  <p>The layout should look like this,</p>
  
  <p><a href="https://i.stack.imgur.com/fgMRz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fgMRz.png" alt="enter image description here"></a></p>
  
  <p>Can someone figure out what else am I missing or doing wrong.
  And If someone knows a better way to scroll a layout, please tell...</p>