title: android children inside relativelayout same height
body: <p>I want two Views inside a RelativeLayout with the same height one below the other.
  I can't use LinearLayout's <strong>weight</strong> so I have to figure out another way to do it.</p>
  
  <p>From what I googled and read on SO I found out as a solution to use an anchor View centerHorizontal in the parent View and place the 2 children one above and one below that anchor View, but it doesn't seems to work.</p>
  
  <p>My code so far is :</p>
  
  <pre><code>    &lt;RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_weight="2"
      android:gravity="top" &gt;
  
          &lt;View android:id="@+id/anchor"
              android:layout_width="0dp"
              android:layout_height="match_parent" 
              android:layout_centerHorizontal="true"
              android:background="#000"/&gt;
  
  
              &lt;RelativeLayout 
                   android:id="@+id/toplayout"                    
                   android:background="#990000"                   
                   android:layout_above="@+id/anchor"
                   android:orientation="horizontal"
                   android:layout_width="match_parent"
                   android:layout_height="match_parent" &gt;
  
              &lt;/RelativeLayout&gt;
  
              &lt;RelativeLayout
                  android:id="@+id/bottomlayout"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:layout_below="@+id/anchor"&gt;
  
                  &lt;RatingBar
                      android:id="@+id/ratingBar1"
                      android:layout_width="218dp"
                      android:layout_height="wrap_content" /&gt;
  
             &lt;/RelativeLayout&gt;        
  
  
     &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Is there a mistake to my code or the way I'm trying to solve it is wrong from the beginning?</p>