title: Android custom listview relativelayout positioning issue
body: <p>I'm relative new to android programming and layouts, and got stuck on creating a custom listview with text and icons. I have checked and tried out several examples, and tried to make my own list view out of those. I'm now at such a point that I don't know what I should do to get this to work like I want it to.</p>
  
  <p>Here's my current result (1st row), and the 2nd row is - my ugly MsPaint edition - of how I'd like it to be. Text which is cropped if it reaches the magnify-glass icon, with the 2 other icons after it.</p>
  
  <p><img src="https://i.stack.imgur.com/1uLVQ.png" alt="Current and wanted state"></p>
  
  <p>I tried quite a few different layouts to accomplish this, and I've been told and read that I should use a relative layout, as those have a better performance and other thingies (which I can't recall right now).</p>
  
  <p>[Edit]<strong>Update and summarized issue:</strong> I have been puzzling a bit more, but I think that my real problem is the fact that the textview does not know in advance that I will put more icons on the right of the magnify glass. This means that it does not 'reserve' any space for those icons, and just takes all the available space, and only leaves some for the magnify icon.[/Edit]</p>
  
  <p>I have 3 xml files which contain my layout. Here's my first file, which is simply the layout I start the screen with:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      style="@style/LayoutWrap"&gt;
  
      &lt;ListView
          android:id="@+id/my_listview"
          style="@style/List"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>The 'xml-file' of 'my_listview' (I know it's a silly name :)):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   style="@style/myListItem"
   android:id="@+id/list"&gt;
  
  
      &lt;TextView
      android:id="@+id/my_item_title"
      style="@style/myItemName"
      android:layout_alignParentLeft="true"
      android:layout_alignParentTop="true"
      android:layout_toLeftOf="@+id/my_item_detail"
      android:text="Name" /&gt;
  
  
  
      &lt;ImageView
          android:id="@id/my_item_detail"
          style="@style/myImageItem"
  
          android:src="@drawable/ic_my_detail_unselected"
          android:contentDescription="Detail"
          android:layout_alignParentRight="true"
          android:layout_alignParentTop="true"
          android:layout_toLeftOf="@+id/my_item_delete"
      /&gt;
  
  
      &lt;ImageView
          android:id="@id/my_item_delete"
          style="@style/myImageItem"
  
          android:src="@drawable/ic_my_delete_unselected"
          android:text="Delete my"
          android:layout_alignParentTop="true"
      /&gt;
  
          &lt;ImageView
          android:id="@+id/my_item_copy"
          style="@style/myImageItem"
  
          android:src="@drawable/ic_my_update_unselected"
          android:text="Copy my"
          android:layout_alignParentTop="true"
          android:layout_toRightOf="@id/my_item_delete"
      /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>In my 'styles.xml' are the styles defined, which don't have any special properties. I think the only interesting thing is that I styled the text having a specific textSize (perhaps an ?android:LargeAppearance or so is better), and that I forced it on one line.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
          &lt;style name="WrapBoth"&gt;
          &lt;item name="android:layout_width"&gt;wrap_content&lt;/item&gt;
          &lt;item name="android:layout_height"&gt;wrap_content&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;style name="WrapHeight"&gt;
          &lt;item name="android:layout_width"&gt;fill_parent&lt;/item&gt;
          &lt;item name="android:layout_height"&gt;wrap_content&lt;/item&gt;
      &lt;/style&gt;
  
          &lt;style name="LayoutWrap"&gt;
          &lt;item name="android:layout_width"&gt;fill_parent&lt;/item&gt;
          &lt;item name="android:layout_height"&gt;fill_parent&lt;/item&gt;   
          &lt;item name="android:orientation"&gt;vertical&lt;/item&gt;        
      &lt;/style&gt;
  
              &lt;style name="List" parent="style/WrapHeight"/&gt;
  
      &lt;style name="myListItem"&gt;
          &lt;item name="android:padding"&gt;5dp&lt;/item&gt;
          &lt;item name="android:layout_width"&gt;fill_parent&lt;/item&gt;
          &lt;item name="android:layout_height"&gt;?android:attr/listPreferredItemHeight&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;style name="myItemName" parent="style/WrapBoth"&gt;
          &lt;item name="android:textSize"&gt;11sp&lt;/item&gt;
          &lt;item name="android:textStyle"&gt;bold&lt;/item&gt;
          &lt;item name="android:ellipsize"&gt;end&lt;/item&gt;
          &lt;item name="android:lines"&gt;1&lt;/item&gt;
          &lt;item name="android:scrollHorizontally"&gt;true&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;style name="myImageItem" parent="style/WrapBoth"&gt;
  
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>I'm already grateful for any help in advance! Meanwhile, I'll work on my 'buttonListeners', I don't expect those to be much of a trouble :)</p>