-1

Actually im fighting with Layouts and i have problem.When i add button in RelativeLayout, he's not exact in place i want him to be.

That is how it looks now

That is how i want it to looks like

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="New Button"
    android:id="@+id/button"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true" />

Thats what i got.So how i can make button be in corner, thats the first question. Second is, how i can delete this blue stuff from top?

xml looks how he looks when start project. I just add button

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
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">


<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="New Button"
    android:id="@+id/button"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true" />

Rasta_Man
  • 19
  • 4

2 Answers2

3

So how i can make button be in corner, thats the first question.

remove this from your RelativeLayout

android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"

you have given padding in your main layout, so this problem occurs

how i can delete this blue stuff from top?

You can remove that part by changing your project theme, refer this to remove actionbar.

Community
  • 1
  • 1
Ravi
  • 34,851
  • 21
  • 122
  • 183
1

You can modify the blue stuff at the top by changing theme. Also, make sure none of your containers have margin or padding, because the small space between the border of the screen and your button seems like coming from this.

Community
  • 1
  • 1
Jorel Amthor
  • 1,264
  • 13
  • 38