title: Setting width ratio in relative layout
body: <p>Im pretty new to Android Layouts.</p>
  
  <p>Im trying to set Age:EditText:Year in ratio 1:3:1 and same size on Height.</p>
  
  <p>Should I use TableLayout? If yes how can i prevent TableRow1 from changing width etc when I do some stuff in other rows?</p>
  
  <p><img src="https://i.stack.imgur.com/kuKET.jpg" alt="enter image description here"></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/relative_layout"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
                            &gt;
  
      &lt;TextView
          android:id="@+id/txtAge"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
           android:layout_alignBaseline="@+id/search_text"
          android:layout_alignBottom="@+id/search_text"
          android:layout_alignParentLeft="true"
          android:text="Age"
          android:layout_weight="0.3"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
   &lt;TextView
          android:id="@+id/txtYears"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBaseline="@+id/search_text"
          android:layout_alignBottom="@+id/search_text"
          android:layout_alignParentRight="true"
          android:text="Years"
          android:layout_weight="0.3"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
      &lt;EditText
          android:id="@+id/search_text"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentTop="true"
          android:layout_toLeftOf="@id/txtYears"
          android:layout_toRightOf="@id/txtAge"
          android:ems="10"
          android:hint="Enter your age"
          android:inputType="text|number"
          android:lines="1"
          android:layout_weight="0.7"
          android:maxLength="2"
          android:maxLines="1" /&gt;
  
  
  
      &lt;TextView
          android:id="@+id/txtHeight"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignBaseline="@+id/enterHeight"
          android:layout_below="@+id/search_text"
          android:text="Height"
          android:textAppearance="?android:attr/textAppearanceLarge" 
          android:layout_weight="1"/&gt;
  
      &lt;Spinner
          android:id="@+id/spinHeight"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_alignTop="@+id/txtHeight"
          android:layout_weight="1" /&gt;
  
      &lt;EditText
          android:id="@+id/enterHeight"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/search_text"
          android:layout_toLeftOf="@+id/spinHeight"
          android:layout_toRightOf="@+id/txtHeight"
          android:ems="10"
          android:hint="Enter your height"
          android:inputType="text|number"
          android:lines="1"
          android:layout_weight="3"
          android:maxLength="3"
          android:maxLines="1" &gt;
  
          &lt;requestFocus /&gt;
      &lt;/EditText&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>