title: layout_weight not adjusting size properly
body: <p>I am trying to make a calculator app. I have a outer <code>linearlayout</code> which is vertical orientation and then have nested linear layouts which have a horizontal orientation where my buttons will go. Only the last nested linear layout is not adjusting the width properly of the buttons as I want the '0' button to take half the width and the '.' and '=' button to take a quarter of the width. I gave the '=' button a layout weight of 0.5 and the '.' &amp; '=' button a layout weight of 0.25 but it still won't work properly. </p>
  
  <p>Here is a screenshot of the graphical layout:</p>
  
  <p><img src="https://i.stack.imgur.com/XBee3.png" alt="enter image description here"></p>
  
  <p>XML code:</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:orientation="vertical" 
  android:background="#000000"
  android:weightSum="1"&gt;
  
  &lt;TextView 
      android:text="0"
      android:layout_width="wrap_content"
      android:layout_weight = "0.25"
      android:layout_height="0dp"
      android:textSize="40sp"
      android:layout_gravity="right"
      android:textColor="#FFFFFF"
      android:id="@+id/tvDisplay"/&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="0dp" 
      android:orientation="horizontal"
      android:layout_weight="0.15"
      android:weightSum="1"&gt;
  
     &lt;Button
         android:id="@+id/bClear"
         android:layout_width="wrap_content"
         android:layout_height="fill_parent"
         android:layout_margin="0.2dp"
         android:layout_weight="0.25"
         android:background="#FFFFFF"
         android:text="C"
         android:textSize="30sp" /&gt;
  
      &lt;Button
          android:id="@+id/bChangeSign"
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:layout_margin="0.2dp"
          android:layout_weight="0.25"
          android:background="#FFFFFF"
          android:text="+/-"
          android:textSize="30sp" /&gt;
  
       &lt;Button
           android:id="@+id/bPercent"
           android:layout_width="wrap_content"
           android:layout_height="fill_parent"
           android:layout_margin="0.2dp"
           android:layout_weight="0.25"
           android:background="#FFFFFF"
           android:text="%"
           android:textSize="30sp" /&gt;
  
       &lt;Button
           android:id="@+id/bDivide"
           android:layout_width="wrap_content"
           android:layout_height="fill_parent"
           android:layout_margin="0.2dp"
           android:layout_weight="0.25"
           android:background="#FF9900"
           android:text="/"
           android:textSize="30sp" /&gt;
  
  &lt;/LinearLayout&gt;
  
    &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="0dp" 
      android:orientation="horizontal"
      android:layout_weight="0.15"&gt;
  
      &lt;Button 
          android:text="7"
          android:background="#FFFFFF"
          android:textSize="30sp"
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:layout_margin="0.2dp"
          android:layout_weight="0.25"
          android:id="@+id/b7"/&gt;
  
     &lt;Button 
          android:text="8"
          android:background="#FFFFFF"
          android:textSize="30sp"
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:layout_margin="0.2dp"
          android:layout_weight="0.25"
          android:id="@+id/b8"/&gt;
  
      &lt;Button 
          android:text="9"
          android:background="#FFFFFF"
          android:textSize="30sp"
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:layout_margin="0.2dp"
          android:layout_weight="0.25"
          android:id="@+id/b9"/&gt;
  
      &lt;Button
          android:id="@+id/bMultiply"
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:layout_margin="0.2dp"
          android:layout_weight="0.25"
          android:background="#FF9900"
          android:text="x"
          android:textSize="30sp" /&gt;
  
  &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="0dp" 
      android:orientation="horizontal"
      android:layout_weight="0.15"&gt;
  
     &lt;Button 
          android:text="4"
          android:background="#FFFFFF"
          android:textSize="30sp"
          android:layout_width="wrap_content"
           android:layout_height="fill_parent"
           android:layout_margin="0.2dp"
           android:layout_weight="0.25"
          android:id="@+id/b4"/&gt;
  
      &lt;Button 
          android:text="5"
          android:background="#FFFFFF"
          android:textSize="30sp"
          android:layout_width="wrap_content"
           android:layout_height="fill_parent"
           android:layout_margin="0.2dp"
           android:layout_weight="0.25"
          android:id="@+id/b5" /&gt;
  
       &lt;Button 
          android:text="6"
          android:background="#FFFFFF"
          android:textSize="30sp"
         android:layout_width="wrap_content"
           android:layout_height="fill_parent"
           android:layout_margin="0.2dp"
           android:layout_weight="0.25"
          android:id="@+id/b6" /&gt;
  
       &lt;Button 
          android:text="-"
          android:background="#FF9900"
          android:textSize="30sp"
          android:layout_width="wrap_content"
           android:layout_height="fill_parent"
           android:layout_margin="0.2dp"
           android:layout_weight="0.25"
          android:id="@+id/bSubtract"
          /&gt;
  
  &lt;/LinearLayout&gt;
  
        &lt;LinearLayout
     android:layout_width="match_parent"
      android:layout_height="0dp" 
      android:orientation="horizontal"
      android:layout_weight="0.15"&gt;
  
      &lt;Button 
          android:text="1"
          android:background="#FFFFFF"
          android:textSize="30sp"
          android:layout_width="wrap_content"
           android:layout_height="fill_parent"
           android:layout_margin="0.2dp"
           android:layout_weight="0.25"
          android:id="@+id/b1" /&gt;
  
     &lt;Button 
          android:text="2"
          android:background="#FFFFFF"
          android:textSize="30sp"
         android:layout_width="wrap_content"
           android:layout_height="fill_parent"
           android:layout_margin="0.2dp"
           android:layout_weight="0.25"
          android:id="@+id/b2" /&gt;
  
      &lt;Button 
          android:text="3"
          android:background="#FFFFFF"
          android:textSize="30sp"
          android:layout_width="wrap_content"
           android:layout_height="fill_parent"
           android:layout_margin="0.2dp"
           android:layout_weight="0.25"
          android:id="@+id/b3" /&gt;
  
       &lt;Button 
          android:text="+"
          android:background="#FF9900"
          android:textSize="30sp"
         android:layout_width="wrap_content"
           android:layout_height="fill_parent"
           android:layout_margin="0.2dp"
           android:layout_weight="0.25"
          android:id="@+id/bPlus" /&gt;
  
  &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:layout_weight="0.15"
              android:orientation="horizontal" 
  
              &lt;Button
                  android:id="@+id/b0"
                  android:layout_width="wrap_content"
                  android:layout_height="fill_parent"
                  android:layout_margin="0.2dp"
                  android:layout_weight="0.5"
                  android:background="#FFFFFF"
                  android:text="0"
                  android:textSize="30sp" /&gt;
  
              &lt;Button
                  android:id="@+id/bDecimal"
                  android:layout_width="wrap_content"
                  android:layout_height="fill_parent"
                  android:layout_margin="0.2dp"
                  android:layout_weight="0.25"
                  android:background="#FFFFFF"
                  android:text="."
                  android:textSize="30sp" /&gt;
  
              &lt;Button
                  android:id="@+id/bEquals"
                  android:layout_width="wrap_content"
                  android:layout_height="fill_parent"
                  android:layout_margin="0.2dp"
                  android:layout_weight="0.25"
                  android:background="#FF9900"
                  android:text="="
                  android:textSize="30sp" /&gt;
          &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>