title: Placing button that overlaps two views in Android
body: <p>I would like to place a button like so (overlapping two views, centered):</p>
  
  <p><a href="https://i.stack.imgur.com/1A2ob.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1A2ob.png" alt="enter image description here"></a></p>
  
  <p>I tried to solve the issue with a RelativeLayout and a negative margin but somehow I can't overlap the two views. Instead the button always get's placed at the bottom of the image view. Any ideas?</p>
  
  <p>Thanks in advance for the help!</p>
  
  <p>Here my code:</p>
  
  <pre><code>&lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"&gt;
  
          &lt;ImageView
              android:id="@+id/tour_image"
              android:layout_width="match_parent"
              android:layout_height="220dp" /&gt;
  
          &lt;RelativeLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentBottom="true"
              android:layout_alignParentEnd="true"
              android:layout_marginBottom="-35dp"
              android:layout_marginEnd="16dp"&gt;
  
              &lt;Button
                  android:id="@+id/go_to_map_button"
                  style="@style/FloatingActionButton.Light"
                  android:layout_width="70dp"
                  android:layout_height="70dp"
                  android:drawableTop="@drawable/ic_directions_walk_color_24dp"
                  android:paddingTop="12dp"
                  android:text="@string/tour_button_show_map"
                  android:textAllCaps="true"
                  android:textAppearance="@style/p.Small"
                  android:textColor="@color/primary_main" /&gt;
          &lt;/RelativeLayout&gt;
      &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The code results in this layout:</p>
  
  <p><a href="https://i.stack.imgur.com/82CCk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/82CCk.png" alt="enter image description here"></a></p>