title: Using layout_alignBaseline and layout_alignBottom in RelativeLayout together
body: <p>I'm trying to get a layout that looks something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/PMArE.png" alt="Relative layout example"></p>
  
  <p>That is:</p>
  
  <ol>
  <li><code>TextView</code> aligned (with margins) to parent left and top.</li>
  <li>An <code>EditText</code> to the left of the <code>TextView</code>, to the right of the <code>Button</code> and baseline-aligned with the <code>TextView</code>.</li>
  <li>A <code>Button</code> aligned (with only a right margin) to the parent right. And here's the broken part: bottom-aligned to the <code>EditText</code>.</li>
  </ol>
  
  <p>For whatever reason it doesn't work. Here's the code I'd expect to work:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
  
      &lt;TextView
          android:id="@+id/text"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          android:layout_marginLeft="32dp"
          android:layout_marginTop="32dp"
          android:text="Text:" /&gt;
  
      &lt;EditText
          android:id="@+id/edit"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBaseline="@+id/text"
          android:layout_toLeftOf="@+id/button"
          android:layout_toRightOf="@+id/text"
          android:ems="10" &gt;
  
          &lt;requestFocus /&gt;
      &lt;/EditText&gt;
  
      &lt;Button
          android:id="@+id/button"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_alignBottom="@+id/edit"
          android:layout_marginRight="32dp"
          android:text="Ok" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>That comes out like this:</p>
  
  <p><img src="https://i.stack.imgur.com/ehPdH.png" alt="Broken RelativeLayout"></p>
  
  <p>What's going on?</p>
  
  <h1>Edit</h1>
  
  <p>Sorry I'm not sure why I changed this example, but in my code I'm actually using an <code>ImageButton</code>, not <code>Button</code>, so the solution can't involve aligning with the baseline of the button - the <code>EditText</code> must be aligned with the <em>bottom</em> (or middle if that is possible) of the button.</p>