XML : Can I add a button?

I am very bad at fixing layouts in android, and I am trying to add a simple button to the top left of the screen. I have already added three buttons in a Relative Layout, and they are just how I want them to be. Now, I want to add one more button, but whenever I try, it messes up the other three buttons:

enter image description here

Here is the code I have:

  <?xml version="1.0" encoding="utf-8"?>  <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"      android:id="@+id/layout"      android:gravity="center"      android:background="@drawable/blurbackground"          xmlns:ads="http://schemas.android.com/apk/res-auto" >            <Button          android:id="@+id/levelone"              android:text="Level One"          android:textColor="#FFFFFF"          android:textSize="30sp"          android:onClick = "levelone"          android:layout_width="270dp"          android:layout_height="100dp"          android:background="@drawable/buttonshape"      //Makes it circular          android:shadowColor="#A8A8A8"          android:shadowDx="0"          android:shadowDy="0"          android:shadowRadius="5"          android:layout_above="@+id/leveltwo"          android:layout_alignParentLeft="true"          android:layout_alignParentStart="true"          android:layout_marginBottom="64dp" />        <Button          android:id="@+id/leveltwo"              android:text="Level Two (UNLOCKED!)"          android:textColor="#FFFFFF"          android:textSize="30sp"          android:onClick = "leveltwo"          android:layout_width="270dp"          android:layout_height="100dp"          android:background="@drawable/buttonshape"          android:shadowColor="#A8A8A8"          android:shadowDx="0"          android:shadowDy="0"          android:shadowRadius="5"          android:layout_alignParentLeft="true"          android:layout_alignParentStart="true"          android:layout_marginBottom="64dp" />            <Button          android:id="@+id/levelthree"              android:text="Level Three (UNLOCKED!)"          android:textColor="#FFFFFF"          android:textSize="30sp"          android:onClick = "levelthree"          android:layout_width="270dp"          android:layout_height="100dp"          android:background="@drawable/buttonshape"          android:shadowColor="#A8A8A8"          android:shadowDx="0"          android:shadowDy="0"          android:shadowRadius="5"          android:layout_below="@+id/leveltwo"          android:layout_alignLeft="@+id/leveltwo"          android:layout_alignStart="@+id/leveltwo" />           </RelativeLayout>    

Please help me add another button without moving the rest of my layouts.

EDIT:

I don't have, nor do I want a tool bar! :)

No comments:

Post a Comment