title: Android overlay outside/between layout boundaries
body: <p>I have to add an overlay (ImageView) so that it's a bit shifted to the left of the containing layout's left boundary.</p>
  
  <p><img src="https://i.stack.imgur.com/O1Jbf.png" alt="enter image description here"></p>
  
  <p>What is the best way to do this?</p>
  
  <p>Tried something simple, like putting the ImageView inside the layout and use negative margin</p>
  
  <pre><code>android:layout_marginLeft="-20dip"
  </code></pre>
  
  <p>This made this:</p>
  
  <p><img src="https://i.stack.imgur.com/eclPA.png" alt="enter image description here"></p>
  
  <p>(Correction: Text in the image should be 20dip not 20px)</p>
  
  <p>AbsoluteLayout is deprecated. Is there something like z-order? Or what do I do?</p>
  
  <p>Thanks in advance.</p>
  
  <p>Edit: I tried using relative layout instead. Same effect. Here's the xml reduced to a minimum:</p>
  
  <pre><code>&lt;RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:clipChildren="false"
  android:paddingLeft="50dip"
  &gt;
  
  &lt;ImageView
      android:id="@+id/myId"
      android:layout_width="60dip"
      android:layout_height="60dip"
      android:layout_marginLeft="-30dip"
      android:clipChildren="false"
      android:src="@drawable/pic" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Result
  <img src="https://i.stack.imgur.com/0oNdo.png" alt="enter image description here"></p>
  
  <p>Also happens when the containing layout has a background image smaller than the screen instead of padding.</p>