title: emulator output different from layout view in android
body: <p>In the layout view my calculator program looks like this<br>
  <img src="https://i.stack.imgur.com/PQIzr.png" alt="enter image description here"></p>
  
  <p>But when I run my program, it looks like this   </p>
  
  <p><img src="https://i.stack.imgur.com/JtFJZ.png" alt="enter image description here">  </p>
  
  <p>Why is this happening?  </p>
  
  <p>This is the layout file code:  </p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context=".MainActivity" &gt;
  
      &lt;Button
          android:id="@+id/button0"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_alignParentLeft="true"
          android:text="@string/button_0"
          android:onClick="onClkBn0" /&gt;
  
      &lt;Button
          android:id="@+id/button_dot"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBaseline="@+id/button0"
          android:layout_alignParentBottom="true"
          android:layout_toRightOf="@+id/button0"
          android:text="@string/button_dot" 
          android:onClick="onClkBnDot"/&gt;
  
      &lt;Button
          android:id="@+id/button_res"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBaseline="@+id/button0"
          android:layout_alignParentBottom="true"
          android:layout_toRightOf="@+id/button_dot"
          android:text="@string/button_res" 
          android:onClick="onClkBnRes"/&gt;
  
      &lt;Button
          android:id="@+id/button1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_above="@+id/button0"
          android:text="@string/button_1" 
          android:onClick="onClkBn1"/&gt;
  
      &lt;Button
          android:id="@+id/button2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBaseline="@+id/button1"
          android:layout_alignBottom="@+id/button1"
          android:layout_toRightOf="@+id/button1"
          android:layout_above="@+id/button_dot"
          android:text="@string/button_2" 
          android:onClick="onClkBn2"/&gt;
  
      &lt;Button
          android:id="@+id/button3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@+id/button2"
          android:layout_toRightOf="@+id/button2"
          android:layout_above="@+id/button_res"
          android:text="@string/button_3" 
          android:onClick="onClkBn3"/&gt;
  
      &lt;Button
          android:id="@+id/button4"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_above="@+id/button1"
          android:layout_alignLeft="@+id/button1"
          android:text="@string/button_4" 
          android:onClick="onClkBn4"/&gt;
  
      &lt;Button
          android:id="@+id/button5"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@+id/button4"
          android:layout_alignLeft="@+id/button2"
          android:text="@string/button_5" 
          android:onClick="onClkBn5"/&gt;
  
      &lt;Button
          android:id="@+id/button6"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@+id/button5"
          android:layout_alignLeft="@+id/button3"
          android:text="@string/button_6" 
          android:onClick="onClkBn6"/&gt;
  
      &lt;Button
          android:id="@+id/button7"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_above="@+id/button4"
          android:layout_alignLeft="@+id/button4"
          android:text="@string/button_7" 
          android:onClick="onClkBn7"/&gt;
  
      &lt;Button
          android:id="@+id/button8"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBaseline="@+id/button7"
          android:layout_alignBottom="@+id/button7"
          android:layout_toRightOf="@+id/button4"
          android:text="@string/button_8" 
          android:onClick="onClkBn8"/&gt;
  
      &lt;Button
          android:id="@+id/button9"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_above="@+id/button6"
          android:layout_alignLeft="@+id/button6"
          android:text="@string/button_9" 
          android:onClick="onClkBn9"/&gt;
  
      &lt;Button
          android:id="@+id/button_plus"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBaseline="@+id/button_res"
          android:layout_alignBottom="@+id/button_res"
          android:layout_toRightOf="@+id/button_res"
          android:text="@string/button_plus" 
          android:onClick="onClkBnPlus"/&gt;
  
      &lt;Button
          android:id="@+id/button_minus"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_above="@+id/button_plus"
          android:layout_alignLeft="@+id/button_plus"
          android:text="@string/button_minus" 
          android:onClick="onClkBnMinus"/&gt;
  
      &lt;Button
          android:id="@+id/button_mul"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/button_minus"
          android:layout_below="@+id/button9"
          android:text="@string/button_mult" 
          android:onClick="onClkBnMult"/&gt;
  
      &lt;Button
          android:id="@+id/button_div"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@+id/button9"
          android:layout_alignLeft="@+id/button_mul"
          android:text="@string/button_div" 
          android:onClick="onClkBnDiv"/&gt;
  
      &lt;Button
          android:id="@+id/button_can"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignRight="@+id/button_div"
          android:layout_centerVertical="true"
          android:text="@string/button_cancel" 
          android:onClick="onClkBnCan"/&gt;
  
      &lt;TextView
          android:id="@+id/mantissa"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_above="@+id/button_can"
          android:layout_alignParentLeft="true"
          android:gravity="right"
          android:text="@string/mantissa_default"
          android:textIsSelectable="true"
          android:textSize="30.0sp" /&gt;
  
      &lt;Button
          android:id="@+id/button_off"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/mantissa"
          android:layout_above = "@+id/button9"
          android:layout_alignLeft="@+id/button9"
          android:layout_toRightOf="@+id/button_can"
          android:onClick="onClkBnOff"
          android:text="@string/button_off" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>