title: how to put an image in center above another image in android?
body: <p>I want to create a layout like this:</p>
  
  <p><img src="https://i.stack.imgur.com/r63Sn.png" alt="enter image description here"></p>
  
  <p>I have 3 different images: the background, the white square and the V sign.</p>
  
  <p>How can I position them as in the photo, if I want the box to move from side to side </p>
  
  <p>and the V sign to fade in\out when onClick is triggered.</p>
  
  <p>I have tried:</p>
  
  <pre><code>   &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="right"
      android:background="@drawable/off_background"&gt;
  
  
               &lt;ImageView
              android:id="@+id/handle"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentTop="true"
              android:layout_centerHorizontal="true"
               android:src="@drawable/handle"
              android:scaleType="centerInside" /&gt;
  
      &lt;ImageView android:id="@+id/switch_v"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:src="@drawable/switch_v"
          android:layout_gravity="center"
          android:scaleType="centerInside"/&gt;
  
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>which gives me the order correctly, but not posed correctly:</p>
  
  <p><img src="https://i.stack.imgur.com/Y7ZjS.png" alt="enter image description here"></p>