Android Build a Simple Android App Creating the Screen Layout Setting Colors

Change the text color to be white

It keeps responding - dont forget to add android:textColor attribute

activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@android:color/white" >

  <TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:text="Treehouse loves me!"
    android:textSize="72sp" />
    android:textColor="color/white" >

</RelativeLayout>

2 Answers

Steve Hunter
MOD
Steve Hunter
Treehouse Moderator 57,656 Points

Hi Iain

Do you need to include @android: before your color:

    android:textSize="72sp" />  // <- move this closing tag
    android:textColor="@android:color/white" />  // <- to here

Also, you have closed the xml tag in the line above - delete the closing tag and move it to the line below. I've commented in the code.

Steve.

Steve Hunter
Steve Hunter
Treehouse Moderator 57,656 Points

The whole TextView element should look like:

  <TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:text="Treehouse loves me!"
    android:textSize="72sp"
    android:textColor="@android:color/white" />

android:background="@color/white"