title: Android: setting leftMargin property to a button automatically resizes it
body: <p>I have a simple button in my layout. Setting <code>leftMargin</code> to the view actually showing different results.</p>
  
  <p>my_layout.xml</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;Button
          android:id="@+id/left_btn"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:padding="10dp"
          android:text="hello pandora"/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>In my activity, I'm setting the <code>leftMargin</code> property to the Button.</p>
  
  <pre><code>Button leftBtn = (Button) findViewById(R.id.left_btn);
  LayoutParams params = (LayoutParams) leftBtn.getLayoutParams();
  params.leftMargin = 550;
  </code></pre>
  
  <p>If I set <code>leftMargin</code> as negative value or 0, its working fine, but If I set the value greater than the width of screen, it just resizing/compressing the button. I am expecting the button to go out of bounds like negative value.</p>
  
  <p><img src="https://i.stack.imgur.com/Nu6ZT.png" alt="enter image description here"></p>
  
  <p>I am expecting the button in the 3rd image to go out of bounds like the button in 1st image.
  <img src="https://i.stack.imgur.com/irrr6.png" alt="enter image description here"></p>
  
  <p>Please don't say to set the button <code>layout_alignParentRight="true"</code> in layout and <code>rightMargin = -50</code>in activity(this works) because I want to move the button from left to right.</p>