Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android

Kevin Michie
Kevin Michie
6,554 Points

Very little of my code has matched up in the design and when I replicate the code, it's nothing like the video.

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:showIn="@layout/activity_main" tools:context="com.kevinmichie.interactivestory.MainActivity">

<ImageView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/titleImageView"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:src="@drawable/main_title"
    android:scaleType="fitXY"
    android:adjustViewBounds="true"
    android:contentDescription="@string/SignalsFromMars"/>

<Button
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="START YOUR ADVENTURE"
    android:id="@+id/startButton"
    android:layout_alignParentBottom="true"
    android:layout_alignLeft="@+id/titleImageView"
    android:layout_alignStart="@+id/titleImageView"
    android:layout_marginBottom="45dp"/>

<EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:inputType="textPersonName"
    android:text="Name"
    android:ems="10"
    android:id="@+id/editText"
    android:layout_above="@+id/startButton"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"/>

</RelativeLayout>

This makes my code look like the example.