title: Android Studio - how to remove white space above layout
body: <p>I am trying to create an Android app with basic textViews, textEdits and Buttons. For some reason, a blank white space appears above the layout. This does not happen in the XML design view but does happen on the Nexus 5, Nexus 5X and the 5.4 FWVGA emulators and on my actual phone (a Huawei P Smart).</p>
  
  <p>I have only just started with Android Studio and do not fully understand layouts, etc... I have tried changing the layout to a relative layout, but it is still there. Also, suggested fixes on Google DIDN'T work.</p>
  
  <p>My activity_main.xml:</p>
  
  <pre><code>'&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:fillViewport="true"
  android:background="@drawable/bg_colour_gradient"
  tools:context=".MainActivity"&gt;
  
  
  &lt;EditText
      android:id="@+id/pi_user"
      style="@android:style/Widget.DeviceDefault.EditText"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginStart="8dp"
      android:layout_marginLeft="8dp"
      android:layout_marginTop="380dp"
      android:layout_marginEnd="8dp"
      android:layout_marginRight="8dp"
      android:layout_marginBottom="8dp"
      android:ems="10"
      android:hint="Pi's SSH Username"
      android:inputType="text"
      android:singleLine="false"
      android:text=""
      app:layout_constraintBottom_toTopOf="@+id/pi_pass"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="parent"
      app:layout_constraintVertical_bias="0.904" /&gt;
  </code></pre>
  
  <p>A screenshot of the app messed up in the emulator, and the design view:</p>
  
  <p><a href="https://i.stack.imgur.com/dd0a4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dd0a4.jpg" alt="App messed up in emulator"></a></p>