A (175)

(Tuis.) #1
CHAPTER 6: Android Screen Design: Writing to the Display Using Activity and View 189

Creating UI Contrast: The TextView Color Parameter


Let’s add a space character after the android:text parameter in our first hello_world
tag, and use the android: work process to bring up the parameter helper dialog. As you can see in
Figure 6-21, I actually typed in android:t which “refined” the parameters displayed in this dialog, to
only include those parameters that begin with the letter “t,” which, as you can see, gives me all of
the android:text related parameters!


Figure 6-21. Change the textColor parameter from gray to white using the pop-up helper


The second parameter is the one I am looking for, android:textColor. So, I selected that one, by
double-clicking on it, so that Eclipse will automatically insert it into my XML mark-up for the
hello_world child tag, and all I have to do is to “configure” it, by using a color data value
that the Android OS understands.


The android:textColor parameter takes a “hexadecimal” or Base-16 color value, which we will be
looking at in greater detail in Chapter 9 on graphic design. For now, all you need to know is the
hexadecimal representation for the color white is #FFFFFF, and thus, that is the color data value
you will need to utilize inside of the quotation marks, once Eclipse has written the empty parameter
for you.


Once you have modified this first child tag, as shown in Figure 6-22, you can copy just
this one parameter (make sure to copy the space character in front of the parameter along with it)
and simply paste it into the other seven child tags in exactly the same location! Your
XML mark-up is getting pretty dense and is about to get even more complex, as we have to add in
seven more tags, to hold data values!

Free download pdf