title: make a layout just fits the width when it's in a HorizonrtalScrollView
body: <p>I have a horizontal <code>LinearLayout</code> that contains bunch of vertical <code>Linearlayouts</code>, each one of these vertical Layouts supposed to fit only 25% of the horizontal layout, so it can only contains four ones, so, i want to add a <code>HorizonrtalScrollView</code> to contain the rest of the vertical layouts when it's number is more than four, </p>
  
  <p>i set the <code>WeightSum</code> of the horizontal layout as four so that any vertical layout will take a weight as one, and that will make it fits only 25% of the horizontal layout. everything is ok before adding the <code>HorizonrtalScrollView</code>, consider the following figure (the vertical layouts is the <strong>Green</strong> colored):</p>
  
  <p><img src="https://i.stack.imgur.com/TYTdA.png" alt="enter image description here"></p>
  
  <p>But when adding the <code>HorizonrtalScrollView</code> :</p>
  
  <p><img src="https://i.stack.imgur.com/JUjkG.png" alt="enter image description here"></p>
  
  <p>I considered setting the horizontal layout as <code>WrapContent</code> and <code>FillParent</code> but the same result, although the same when setting <code>HorizonrtalScrollView</code> as <code>WrapContent</code> and <code>FillParent</code> . </p>
  
  <p><strong>XML code:</strong></p>
  
  <pre><code>      &lt;HorizontalScrollView 
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content" &gt;
           &lt;LinearLayout 
                         android:layout_width="fill_parent"
                         android:layout_height="wrap_content"
                         android:orientation="horizontal"
                         android:weightSum="4" &gt;
  
          &lt;LinearLayout
                      android:id="@+id/innerVer1"
                      android:layout_width="0dp"
                      android:layout_height="wrap_content"
                      android:layout_weight="1"
                      android:orientation="vertical"
                      android:weightSum="1" &gt;
  
                      &lt;LinearLayout
                          android:id="@+id/icon1"
                          android:layout_width="wrap_content"
                          android:layout_height="0dp"
                          android:layout_marginLeft="10dp"
                          android:layout_marginRight="5dp"
                          android:layout_marginTop="15dp"
                          android:layout_weight="0.5"
                          android:background="@drawable/ac_overlay"
                          android:orientation="horizontal"
                          android:tag="normal" &gt;
                      &lt;/LinearLayout&gt;
  
                      &lt;LinearLayout
                          android:id="@+id/icon2"
                          android:layout_width="wrap_content"
                          android:layout_height="0dp"
                          android:layout_marginLeft="10dp"
                          android:layout_marginRight="5dp"
                          android:layout_marginTop="15dp"
                          android:layout_weight="0.5"
                          android:background="@drawable/ac_overlay"
                          android:orientation="horizontal"
                          android:tag="normal" &gt;
                      &lt;/LinearLayout&gt;
                  &lt;/LinearLayout&gt;
           &lt;LinearLayout
                      android:id="@+id/innerVer1"
                      android:layout_width="0dp"
                      android:layout_height="wrap_content"
                      android:layout_weight="1"
                      android:orientation="vertical"
                      android:weightSum="1" &gt;
  
                      &lt;LinearLayout
                          android:id="@+id/icon1"
                          android:layout_width="wrap_content"
                          android:layout_height="0dp"
                          android:layout_marginLeft="10dp"
                          android:layout_marginRight="5dp"
                          android:layout_marginTop="15dp"
                          android:layout_weight="0.5"
                          android:background="@drawable/ac_overlay"
                          android:orientation="horizontal"
                          android:tag="normal" &gt;
                      &lt;/LinearLayout&gt;
  
                      &lt;LinearLayout
                          android:id="@+id/icon2"
                          android:layout_width="wrap_content"
                          android:layout_height="0dp"
                          android:layout_marginLeft="10dp"
                          android:layout_marginRight="5dp"
                          android:layout_marginTop="15dp"
                          android:layout_weight="0.5"
                          android:background="@drawable/ac_overlay"
                          android:orientation="horizontal"
                          android:tag="normal" &gt;
                      &lt;/LinearLayout&gt;
                  &lt;/LinearLayout&gt;
                      &lt;/LinearLayout&gt;
      &lt;/HorizontalScrollView&gt;
  </code></pre>