title: Understanding weight and layout_weight, the bigger layout_weight is, more it shrinks in the layout.
body: <p>I am trying to understand the weight layout with this example.</p>
  
  <p>It is definitely not a rocket science. However, this example making it...</p>
  
  <ul>
  <li>The weightSum dictate how big the size is and </li>
  <li>Then divide the layout based on layout_weight value for the view in LinearLayout.</li>
  </ul>
  
  <p>In this example I have a layout, weighted with 5, that is then divided between two views:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:background="@color/transactionRowBackground"
      android:paddingBottom="5dp"
      android:paddingTop="5dp" android:orientation="horizontal" &gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical" android:layout_weight="2" &gt;
  
          &lt;TextView
              android:id="@+id/title"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:clickable="true"
              android:gravity="top"
              android:padding="5dp"
              android:text="Test Title"
              android:textColor="@color/textColor"
              android:textSize="@dimen/subHeadingTextSize"
              android:textStyle="bold" /&gt;
  
          &lt;TextView
              android:id="@+id/description"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:clickable="true"
              android:gravity="top"
              android:padding="5dp"
              android:text="This is a test description"
              android:textColor="@color/textColor"
              android:textSize="@dimen/normalTextSize" /&gt;
  
      &lt;/LinearLayout&gt;
  
  
      &lt;ImageView
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="3"
          android:src="@drawable/ic_launcher"
          android:layout_gravity="top"
          android:contentDescription="" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>The thing that I cannot understand is the bigger number I give to ImageViewer the smallest space it get from the parent. So how it is actually calculating the size for ImageView.</p>
  
  <p>You can try with the above xml. If you change the layout weight of an ImageView to 1 , and child linearlayout to 4, that I believe makes more sense, then the opposite will occur.</p>
  
  <p>ImageView will expend and child linearlayout will shrink. I thought the bigger the number is more you get some space.</p>