title: How to center android application attributes in visual studio?
body: <p>I have made a login activity in visual studio and everything seems fine in the designer tab. But when exported to a physical device, everything is off centred. How can I fix this issue? </p>
  
  <p>Heres the XML for the activity:</p>
  
  <pre><code>&lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:minWidth="25px"
      android:minHeight="25px"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/relativeLayout"
      android:background="@drawable/carbon"
      android:gravity="center"&gt;
      &lt;Button
          android:layout_marginTop="360dp"
          android:layout_marginLeft="65dp"
          android:layout_width="250dp"
          android:fontFamily="sans-serif-medium"
          android:text="login"
          android:textSize="35px"
          android:id="@+id/loginButton"
          android:layout_height="wrap_content"
          android:background="@drawable/rounded_button"/&gt;
      &lt;ImageView
          android:layout_width="200px"
          android:layout_height="200px"
          android:layout_marginLeft="280px"
          android:layout_marginTop="80px"
          android:layout_marginRight="280px"
          android:layout_marginBottom="500px"
          android:src="@drawable/email1"/&gt;
      &lt;EditText
          android:id="@+id/username"
          android:layout_width="300dp"
          android:layout_height="47dp"
          android:layout_marginStart="97dp"
          android:layout_marginLeft="43dp"
          android:layout_marginTop="200dp"
          android:layout_marginEnd="12dp"
          android:layout_marginRight="43dp"
          android:layout_marginBottom="58dp"
          android:textColorHint="@android:color/black"
          android:hint="Email"
          android:ems="10"
          android:background="@drawable/rounded_edittext"
          android:inputType="textEmailAddress"
          android:alpha=".9"
          android:paddingLeft="60dp"/&gt;
      &lt;EditText
          android:id="@+id/password"
          android:layout_width="300dp"
          android:layout_height="47dp"
          android:layout_marginStart="97dp"
          android:layout_marginLeft="43dp"
          android:layout_marginTop="280dp"
          android:layout_marginEnd="12dp"
          android:layout_marginRight="43dp"
          android:layout_marginBottom="58dp"
          android:ems="10"
          android:textColorHint="@android:color/black"
          android:hint="Password"
          android:background="@drawable/rounded_edittext"
          android:inputType="textPassword"
          android:alpha=".9"
          android:paddingLeft="60dp"/&gt;
      &lt;ImageView
          android:layout_width="70px"
          android:layout_height="70px"
          android:layout_marginLeft="120px"
          android:layout_marginTop="415px"
          android:layout_marginBottom="415px"
          android:layout_marginRight="120px"
          android:src="@drawable/email"/&gt;
      &lt;ImageView
          android:layout_width="40px"
          android:layout_height="40px"
          android:layout_marginLeft="120px"
          android:layout_marginTop="590px"
          android:layout_marginBottom="415px"
          android:layout_marginRight="120px"
          android:src="@drawable/key"/&gt;
      &lt;TextView
          android:layout_width="80dp"
          android:layout_height="40dp"
          android:layout_marginLeft="155dp"
          android:layout_marginTop="150dp"
          android:textColor="#ffb702"
          android:text="Login"
          android:fontFamily="sans-serif-medium" 
          android:textSize="50px"/&gt;
      &lt;TextView
          android:layout_width="130dp"
          android:layout_height="30dp"
          android:layout_marginLeft="130dp"
          android:layout_marginTop="335dp"
          android:textColor="#ffb702"
          android:autoLink="all"
          android:linksClickable="true"
          android:textColorLink="#ffb702"
          android:text="Forgot Password?"
          android:fontFamily="sans-serif-medium" 
          android:textSize="30px"/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>StackOverflow isn't letting me post this question without adding more details so now I will add random garbage. fjsfkdsfkshfksgklsjdlksdjlfklsdjfgjfkljflskfjslkjdfksjfskljfdkljfslkfjsfjsklfjslkfjsklfjslkfjdslkfjslkdjfslkfjslkfjdslkfjslkfjslkjfdslkjfslkfjslkdjfslkjflkjfsfjsdlkjflskjfjlskjfksjfksjfskfslfjldkjfsklfjlksdjfslkfjslkfjslkfjskfjskfjskjfsklfjslkjfldkjfldkjfdlkjflksdjfslkjfslkfjkldfjslkfjdlksj</p>
  
  <p>the image below shows what happens after the app is launched on a real phone</p>
  
  <p><a href="https://i.stack.imgur.com/FX2Eg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FX2Eg.jpg" alt="everything is missaligned"></a></p>