title: Image overlay over relative layouts
body: <p>I have two relative layouts with rounded rectangular borders without any space between them .
  I want an image to be overlaid on the common line thus generated by the borders
  how can this be achieved?</p>
  
  <p><img src="https://i.stack.imgur.com/KPjEa.png" alt="enter image description here"></p>
  
  <p>Layout code :</p>
  
  <pre><code>//COde for the layout.
    &lt;RelativeLayout
                  android:id="@+id/Layout1"
                  android:layout_width="300dp"
                  android:layout_height="60dp"
                  android:layout_below="@id/selectText"
                  android:layout_marginLeft="10dp"
                  android:background="@layout/rounded_border_1" &gt;
  
                  &lt;TextView
                      android:id="@+id/Text1"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_alignParentLeft="true"
                      android:layout_centerInParent="true"
                      android:layout_marginLeft="10dp"
                      android:text="@string/string1"
                      android:textColor="@color/text_color"
                      android:textSize="14sp" /&gt;
  
                  &lt;TextView
                      android:id="@+id/Name1"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_alignBaseline="@id/Text1"
                      android:layout_alignParentRight="true"
                      android:layout_marginRight="20dp"
                      android:hint="@string/hint"
                      android:textColor="@color/hint_color"
                      android:textSize="14sp" /&gt;
              &lt;/RelativeLayout&gt;
  
  //code for the image
              &lt;ImageButton
                  android:id="@+id/image"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginLeft="30dp"
                  android:src="@drawable/swap"/&gt;
  
  //code for the layout
              &lt;RelativeLayout
                  android:id="@+id/Layout2"
                  android:layout_width="300dp"
                  android:layout_height="60dp"
                  android:layout_below="@id/Layout1"
                  android:layout_marginLeft="10dp"
                  android:background="@layout/rounded_border_2" &gt;
  
                  &lt;TextView
                      android:id="@+id/Text2"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_alignParentLeft="true"
                      android:layout_centerInParent="true"
                      android:layout_marginLeft="10dp"
                      android:text="@string/string2"
                      android:textColor="@color/text_color"
                      android:textSize="14sp" /&gt;
  
                  &lt;TextView
                      android:id="@+id/Name2"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_alignBaseline="@id/Text2"
                      android:layout_alignParentRight="true"
                      android:layout_marginRight="20dp"
                      android:hint="@string/hint"
                      android:textColor="@color/hint_color"
                      android:textSize="14sp" /&gt;
              &lt;/RelativeLayout&gt;
      //Code for the border1
  </code></pre>
  
  <p>rounded_border_1.xml</p>
  
  <pre><code>    &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
          android:shape="rectangle" &gt;
  
          &lt;gradient
              android:angle="270"
              android:endColor="@color/gradient_end"
              android:startColor="@color/gradient_start" /&gt;
  
          &lt;stroke
              android:width="1dp"
              android:color="@color/canvas_border" /&gt;
  
          &lt;corners
              android:bottomLeftRadius="0dp"
              android:bottomRightRadius="0dp"
              android:topLeftRadius="5dp"
              android:topRightRadius="5dp" /&gt;
  
      &lt;/shape&gt;
  </code></pre>
  
  <p>rounded_border_2.xml</p>
  
  <pre><code>    &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
          android:shape="rectangle" &gt;
  
          &lt;gradient
              android:angle="270"
              android:endColor="@color/gradient_end"
              android:startColor="@color/gradient_start" /&gt;
  
          &lt;stroke
              android:width="1dp"
              android:color="@color/canvas_border" /&gt;
  
          &lt;corners
              android:bottomLeftRadius="5dp"
              android:bottomRightRadius="5dp"
              android:topLeftRadius="0dp"
              android:topRightRadius="0dp" /&gt;
  
      &lt;/shape&gt;
  </code></pre>