title: How does android:layout_weight work?
body: <p>When I have the following, it shows top layout with four colors has much smaller area than the bottom layout area.</p>
  
  <p>According to <a href="http://developer.android.com/guide/topics/ui/layout-objects.html#linearlayout" rel="nofollow noreferrer">this documentation</a>, when you add more to <code>layout_weight</code>, it should increase the area, but it decreases in the code.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
  
    &lt;LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="4"&gt;
        &lt;TextView
            android:text="red"
            android:gravity="center_horizontal"
            android:background="#aa0000"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="3"/&gt;
        &lt;TextView
            android:text="green"
            android:gravity="center_horizontal"
            android:background="#00aa00"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="1"/&gt;
        &lt;TextView
            android:text="blue"
            android:gravity="center_horizontal"
            android:background="#0000aa"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="1"/&gt;
        &lt;TextView
            android:text="yellow"
            android:gravity="center_horizontal"
            android:background="#aaaa00"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="1"/&gt;
    &lt;/LinearLayout&gt;
  
    &lt;LinearLayout
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:layout_weight="1"&gt;
      &lt;TextView
          android:text="row one"
          android:textSize="15pt"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"/&gt;
      &lt;TextView
          android:text="row two"
          android:textSize="15pt"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"/&gt;
      &lt;TextView
          android:text="row three"
          android:textSize="15pt"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"/&gt;
      &lt;TextView
          android:text="row four"
          android:textSize="15pt"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"/&gt;
    &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>