title: Android - split view with button on top
body: <p><br><br>I am trying to split screen in android and trying to overlay a button on top of divider</p>
  
  <p>Below is the current and expected <a href="https://i.stack.imgur.com/cBWpJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cBWpJ.jpg" alt="Current Scenario nad Expected"></a></p>
  
  <p>Below is my XML layout file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#FF0000"
      android:weightSum="2"&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="1"
          android:background="#ff0000" /&gt;
  
      &lt;RelativeLayout
          android:background="#00ff00"
          android:layout_height="0dp"
          android:layout_width="match_parent"
          android:layout_weight="1"&gt;
  
          &lt;ImageButton
              android:id="@+id/imageButton"
              android:layout_width="90sp"
              android:layout_height="90sp"
              app:srcCompat="@drawable/exchange"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="-45dp"/&gt;
  
      &lt;/RelativeLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>