title: Android Layout Weight not working with relative layout
body: <p><img src="https://i.stack.imgur.com/865L9.png" alt="enter image description here" /></p>
  <p>I am trying to implement layout weight for the first time, a bit I tried with linear layout it works good, but when I tried with relative and linear layout something went wrong. What is wrong here?</p>
  <p>My XML File</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  android:id=&quot;@+id/Linearlayout&quot;
  android:layout_width=&quot;fill_parent&quot;
  android:layout_height=&quot;fill_parent&quot;
  android:orientation=&quot;vertical&quot;
  android:weightSum=&quot;100&quot; &gt;
  
  &lt;RelativeLayout
      android:id=&quot;@+id/Rlayout&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;fill_parent&quot;
      android:layout_weight=&quot;45&quot; &gt;
  
      &lt;Gallery
          android:id=&quot;@+id/Gallery01&quot;
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;fill_parent&quot;
          android:spacing=&quot;4dip&quot; &gt;
      &lt;/Gallery&gt;
  &lt;/RelativeLayout&gt;
  
  &lt;RelativeLayout
      android:id=&quot;@+id/Rlayout1&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;fill_parent&quot;
      android:layout_weight=&quot;10&quot;
      android:orientation=&quot;vertical&quot; &gt;
  
      &lt;ImageView
          android:id=&quot;@+id/ImageView01&quot;
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;fill_parent&quot;
          android:scaleType=&quot;fitXY&quot; /&gt;
  
      &lt;ImageView
          android:id=&quot;@+id/ImageView02&quot;
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;fill_parent&quot;
          android:scaleType=&quot;fitXY&quot; /&gt;
  &lt;/RelativeLayout&gt;
  
  &lt;LinearLayout
      xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:id=&quot;@+id/navbar&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;fill_parent&quot;
      android:layout_weight=&quot;45&quot;
      android:background=&quot;@drawable/button1&quot;
      android:orientation=&quot;horizontal&quot;
      android:weightSum=&quot;100&quot; &gt;
  
      &lt;Button
          android:id=&quot;@+id/makerback&quot;
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;fill_parent&quot;
          android:layout_gravity=&quot;center&quot;
          android:layout_weight=&quot;20&quot;
          android:background=&quot;@drawable/makerback&quot; /&gt;
  
      &lt;Button
          android:id=&quot;@+id/makerphoto&quot;
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;fill_parent&quot;
          android:layout_gravity=&quot;center&quot;
          android:layout_weight=&quot;20&quot;
          android:background=&quot;@drawable/makerphoto&quot; /&gt;
  
      &lt;Button
          android:id=&quot;@+id/makerselves&quot;
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;fill_parent&quot;
          android:layout_gravity=&quot;center&quot;
          android:layout_weight=&quot;20&quot;
          android:background=&quot;@drawable/makerselves&quot; /&gt;
  
      &lt;Button
          android:id=&quot;@+id/makerskins&quot;
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;fill_parent&quot;
          android:layout_gravity=&quot;center&quot;
          android:layout_weight=&quot;20&quot;
          android:background=&quot;@drawable/makerskins&quot; /&gt;
  
      &lt;Button
          android:id=&quot;@+id/makersave&quot;
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;fill_parent&quot;
          android:layout_gravity=&quot;center&quot;
          android:layout_weight=&quot;20&quot;
          android:background=&quot;@drawable/makersave&quot; /&gt;
  &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  <p>I need to achieve the above image:</p>