title: How do I draw a vertical line inside an expandable content RelativeLayout
body: <p>I'm fronting a problem to draw a vertical line inside a relative layout as a list item layout like this:    </p>
  
  <p><img src="https://i.stack.imgur.com/IKQQe.jpg" alt="list view item layout, what do i whant">        </p>
  
  <p>layout's height is changes from item to item, here is the code:   </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:background="@color/white"&gt;
  
  &lt;Button android:id="@+id/button1" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_alignParentTop="true" 
          android:layout_alignParentLeft="true" 
          android:layout_marginLeft="3dip" 
          android:layout_marginTop="3dip" 
          android:text="Button"&gt;&lt;/Button&gt;
  
  &lt;TextView android:id="@+id/title" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_alignTop="@+id/button1" 
            android:layout_toRightOf="@+id/button1"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="@color/black" 
            android:text="TextView"&gt;&lt;/TextView&gt;
  
  &lt;TextView android:id="@+id/expandable_text" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_below="@+id/title" 
            android:layout_toRightOf="@+id/button1"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="@color/black" 
            android:text="Some expandable text"&gt;&lt;/TextView&gt;
  
  &lt;View android:id="@+id/vertical_line"
        android:layout_width="5dip" 
        android:layout_height="fill_parent"
        android:layout_alignParentRight="true"
        android:layout_marginRight="4dip"
        android:background="@color/orange"/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The problem is that the vertical line is not visible / working, any suggestions?<br>
  <strong>Thanks in advance!</strong></p>
  
  <p>p.s<br>
  note that this problem has been solved when doing it with LinearLayout, but I had performances issues due to nested views in the layout, and the only solution is in using RelativeLayout, also, the TextViews lines is changing from item to item.    </p>
  
  <p><strong>Solution #1</strong><br>
  After searching for a while, and using the suggested answers posted here (thanks..)<br>
  I've found a solution, <strong>which seems to be pretty ugly</strong>, but due to problems with filling a<br>
  RelativeLayout using "fill_parent" height, while the layout height itself sets to "wrap_content", it seems to be a reasonable option.    </p>
  
  <p>The idea is to takes the uppermost view (the button) and the bottom most view (the expandable text), and use them as anchors alignments to the height of the vertical line.<br>
  as you can see in this code:    </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:background="@color/white"&gt;
  
  &lt;Button android:id="@+id/button1" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_alignParentTop="true" 
          android:layout_alignParentLeft="true" 
          android:paddingTop="3dip" 
          android:layout_marginTop="3dip" 
          android:text="Button"&gt;&lt;/Button&gt;
  
  &lt;TextView android:id="@+id/title" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_alignTop="@+id/button1" 
            android:layout_toRightOf="@+id/button1"
            android:paddingTop="3dip"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="@color/black" 
            android:text="TextView"&gt;&lt;/TextView&gt;
  
  &lt;TextView android:id="@+id/expandable_text" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_below="@+id/title" 
            android:layout_toRightOf="@+id/button1"
            android:paddingBottom="10dip"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="@color/black" 
            android:text="Some expandable text"&gt;&lt;/TextView&gt;
  
  &lt;View android:id="@+id/vertical_line"
        android:layout_width="5dip" 
        android:layout_height="fill_parent"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@id/list_item_task_statusbutton"
        android:layout_alignBottom="@id/list_item_task_description"
        android:layout_marginRight="4dip"
        android:background="@color/orange"/&gt;
  
  &lt;/RelativeLayout&gt;    
  </code></pre>
  
  <p>Note for the changes in the views, especially the replacement of "android:marginXXXX=value" 
  with "android:paddingXXXX=value" for fixing the views positions.    </p>
  
  <p>Thanks.. and Good Day!</p>