Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

positioning a button

when i drag the button on to the screen i get rendering problems...whats happening?

2 Answers

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="@dimen/abc_dropdownitem_text_padding_right" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".TestAppActivity">

<TextView

   android:text="\@string/Did you know?"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
    android:textSize="24sp" />

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="\@string/Ants sketch when they wake up in the morning"
    android:id="@+id/textView"
    android:layout_centerVertical="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_marginLeft="60dp"
    android:layout_marginStart="60dp"
    android:textSize="15sp"
    android:layout_alignParentRight="false"
    android:layout_alignParentEnd="false" />

Hello Michael,

can you post the xml code?

Check if you are dragging the button on a Relative Layout. That will make the button have a position related to the nearest object/corner.