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

Text Color for BlogReader App

Hey Team Treehouse! I have a question in regards to changing colors for the list view made in the BlogReader App tutorial. I went and changed the background to black, but since the letters of the list view are black as well, I can't see them on the emulator. How do I change the color of the items to say, blue or white? I also want to play around with the transparency a little, but I'm not sure how to do that either.

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

There are different ways to do this, but the easiest is probably to use a style, like this StackOverflow answer: http://stackoverflow.com/questions/2354176/changing-text-color-of-list-view-in-android

Which transparency do you want to play around with? In other words, which element of the list? The background? The text? You probably want to play around with the aarrggbb color value, like mentioned in the Color State List Resource documentation:

android:color

Hexadeximal color. Required. The color is specified with an RGB value and optional alpha channel.

The value always begins with a pound (#) character and then followed by the Alpha-Red-Green-Blue information in one of the following formats:

#RGB

#ARGB

#RRGGBB

#AARRGGBB

I didn't realize there was a styles xml file! I saw that that existed in another tutorial and felt kind of dumb, but oh well! Thanks for the reply Ben! I appreciate it! Going to do a little bit of homework here and then get cracking playing around with the code! I would also like to make the list boxes, themselves, a little bit transparent. That way if I added an image in the background, it could be slightly visible without being overwhelming, just for some pleasant styling. Enjoy your Labor Day weekend!