title: Prevent views from overlapping in RelativeLayout
body: <p>I'm trying to develop an android application, but I'm having some problems with the GUI design. The following part of screenshot is my problem (red and blue lines were generated by Android debug options).</p>
  
  <p><img src="https://i.stack.imgur.com/ysWbl.png" alt="my problem"></p>
  
  <p>This is the code:</p>
  
  <pre><code>&lt;RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignLeft="@+id/caption"
      android:layout_below="@+id/caption" &gt;
  
      &lt;ImageButton
          android:id="@+id/button_edit"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerVertical="true"
          android:layout_alignParentRight="true"
          android:src="@drawable/content_edit"
          style="?android:attr/borderlessButtonStyle" /&gt;
  
      &lt;TextView
          android:id="@+id/myText"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_centerVertical="true"
          android:text="@string/num_placeholder"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>As you can see, the TextView myText overlaps the ImageButton button_edit.
  A simple solution would be to use a LinearLayout instead of a RelativeLayout. The problem is that:</p>
  
  <ol>
  <li>I need the edit button on the right</li>
  <li>I need the text to fill the rest of the layout (at the left of edit button obviously)</li>
  </ol>
  
  <p>I also tried to set myText's layout_width to 'fill_parent', but it fill the entire rest of the screen at the left of the edit button.</p>
  
  <p><strong>The expected behavior</strong> would be myText to increase its height (becoming a two-lines TextView) instead of overlapping 'button_edit'</p>
  
  <p>Can anyone help me? Thanks</p>