title: RelativeLayout, align a view at the bottom of another view but always below another
body: <p>I am going mad with a layout problem, based on the following image
  <img src="https://i.stack.imgur.com/whUXx.png" alt="Layout problem"></p>
  
  <p>The image represents a RelativeLayout. I need the blue view to be aligned with the bottom of the black one. BUT, if the black view is shorter than the sum of the red one and the blue one, I need the blue view to be below the red one. I want to have this result:</p>
  
  <p><img src="https://i.stack.imgur.com/XycOX.png" alt="Right result"></p>
  
  <p>I tried with the following xml:</p>
  
  <pre><code>&lt;RelativeLayout
      android:id="@+id/container"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"&gt;
      &lt;View
          android:id="@+id/blackView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:align_parentTop="true"
          android:align_parentLeft="true"/&gt;
      &lt;View
          android:id="@+id/redView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:align_parentTop="true"
          android:align_parentRight="true"
          android:layout_toRightOf="@+id/blackView"/&gt;
      &lt;View
          android:id="@+id/blueView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@+id/blackView"
          android:layout_below="@+id/redView"
          android:layout_alignParentRight="true"/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>but it seems that the layout_alignBottom has a higher priority over the layout_below.
  I also tried to set the blueView aligned with the bottom of its parent but the result is that the parent (having a <code>wrap_content</code> height) become high as its own parent (the whole screen height).</p>
  
  <p>Does anyone had the same problem?</p>