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 triallance rousey
911 PointsWhere do i put the color code in the background layout
Now let's change the background color of the whole RelativeLayout to a dark pink. Use the code #fff092b0..
lance rousey
911 PointsThat was for the first one yes but the second one wants dark pink i put where is says android:background="@android:color/white" i put the #fff092b0 where the white is so it said android:background="@android:color/#fff092b0 but still says its wrong.. idk where to put the color code at to change the background color from white to dark pink
3 Answers
notf0und
11,940 PointsYou just need to drop out the @android:color/
part. That is for referencing colors that are pre-defined in the Android system, like "white", "black", "yellow", etc.
Juan Gallardo
1,568 Pointsandroid:background="#fff092b0"
MUZ140028 Charlton Sibanda
5,615 Pointsthanks for the answer
A X
12,842 PointsWhy do we drop the @android part of the code though? I thought that @android was a standard part of the XML language....it works to drop it, but it seems to go against what little I know about programming languages consistency.
notf0und
11,940 Pointsnotf0und
11,940 PointsIs this what you tried for an answer:
android:textColor="@android:color/white"
?