title: How to stop TextView expanding too far past other items RelativeLayout?
body: <p>I have a TextView and an ImageView in Relative Layout:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent" android:layout_height="match_parent"
      android:paddingLeft="10dip" android:id="@+id/itemRoot"
      android:clickable="false"&gt;
  
      &lt;TextView android:layout_width="wrap_content" android:text="TextView"
          android:layout_height="wrap_content" android:id="@+id/itemTxt"
          android:layout_alignParentLeft="true" android:layout_centerVertical="true"
          android:singleLine="true"&gt;&lt;/TextView&gt;
      &lt;ImageView android:id="@+id/delBtn" android:layout_height="wrap_content"
          android:src="@drawable/delete" android:layout_width="wrap_content"
          android:layout_alignParentRight="true" android:paddingRight="10dip"
          android:layout_centerVertical="true"&gt;&lt;/ImageView&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>However, when text gets too long it overlaps with the ImageView goes under it all the way to the end of the screen and then "...". But I want it to stop where ImageView begins. I can't stretch the TextView all the way to ImageView because I also have some backgrounds underneath that look ugly. So I tried adding a blank, transparent spacer between the 2 Views:</p>
  
  <pre><code>&lt;TextView android:layout_width="wrap_content"
          android:layout_height="wrap_content" android:id="@+id/spacer"
          android:layout_alignTop="@+id/itemTxt" android:layout_alignBottom="@+id/itemTxt"
          android:layout_toLeftOf="@+id/delBtn" android:layout_toRightOf="@+id/itemTxt"
          android:minWidth="5dip" android:background="@android:color/transparent"&gt;&lt;/TextView&gt;
  </code></pre>
  
  <p>However, I still have the same problem. The spacer works nicely as long as text is not too long. But because itemTxt defined with respect to the ParentLeft it just pushes the spacer out of the screen, and I can't define it also with respect to the spacer as SDK complains that it is circular.</p>
  
  <p>Any thoughts?</p>
  
  <p>Alex</p>