title: RelativeLayout - can't make views the same vertical size if they are horizontally aligned
body: <p>I have a layout which has two <code>CardView</code>'s and looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/KizSo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KizSo.png" alt="enter image description here"></a></p>
  
  <p>I wanted the right card to be fixed width (90dp) and the left one to automatically resize and fill the remaining space. I have currently done it like this:</p>
  
  <pre><code>    &lt;RelativeLayout
          android:id="@+id/inventory_host_layout"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentTop="true"&gt;
  
          &lt;android.support.v7.widget.CardView
              android:id="@+id/inventory_last_scanned_wrapper_card"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginLeft="20dp"
              android:layout_marginRight="20dp"
              android:layout_marginTop="20dp"
              android:layout_toLeftOf="@+id/inventory_scanned_infobox_wrapper_card"&gt;
  
              ...
  
          &lt;/android.support.v7.widget.CardView&gt;
  
          &lt;android.support.v7.widget.CardView
              android:id="@+id/inventory_scanned_infobox_wrapper_card"
              android:layout_width="90dp"
              android:layout_height="wrap_content"
              android:layout_alignParentBottom="false"
              android:layout_alignParentRight="true"
              android:layout_alignParentTop="true"
              android:layout_centerVertical="false"
              android:layout_marginRight="20dp"
              android:layout_marginTop="20dp"&gt;
  
              ...
  
          &lt;/android.support.v7.widget.CardView&gt;
  
      &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Left one can grow, so I also wanted the right card to always be the same height as the left one. Usually I do that kind of alignment by setting both <code>layout_alignTop</code> and <code>layout_alignBottom</code> properties to other <code>View</code> but those properties are not available this time, probably because that would create a circular reference (although I don't really understand how horizontal alignment could affect vertical). What to do? I have explored several other options but always get back to the same point except hardcoding heights or setting them programmatically which of course I want to avoid.</p>