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 Styles and Themes in Android Using Styles in Layouts Styling EditTexts and Buttons

shahaf cohen
shahaf cohen
1,896 Points

receiving this error - Bummer! Don't forget to include 'android:layout_alignParentLeft' in the style!

I did put it in the style but I still receive this error. can't move forword...

styles.xml
<resources xmlns:android="http://schemas.android.com/apk/res/android">
  <style name="CustomEditText">
    <item name="android:layout_width=">match_parent</item>
    <item name="android:layout_height=">wrap_content</item>
    <item name="android:layout_alignParentLeft=">true</item>
    <item name="android:hint=">@string/hint_name</item>
    <item name="android:textSize=">20sp</item>
    <item name="android:textColor=">@color/dark_green</item>
  </style>
</resources>
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <EditText
        android:id="@+id/nameField"
        style="@style/CustomEditText"
        android:layout_alignParentTop="true"/>

    <EditText
        android:id="@+id/cityField"
        android:layout_below="@id/nameField"
        style="@style/CustomEditText"/>

</RelativeLayout>

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! I suspect something happened when you were copying and pasting because each one of your items has an extra equals sign before the closing quotation marks. Take a look:

// What you typed
<item name="android:layout_width=">match_parent</item>

// Should look like
<item name="android:layout_width">match_parent</item>

However, when you fix this part there will be something else you'll need to fix, but I'll let the challenge explain that.

Hope this helps! :sparkles: