A (175)

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

Also, notice that I have deleted the android:padding parameters, since we are going to learn about
how to use the android:margin parameters to control the spacing of our UI design on the Activity
screen, after we add in the child tags that will make up the galaxy information label
portion of our UI design. First, let’s use the Run As ➤ Android Application work process, and look
at our UI design, shown on the left in Figure 6-15.


Figure 6-15. The Nexus One AVD with the changed title text, the added galaxy info labels, and margins


Let’s create the seven child tags the easy way. Select the hello_world
tag, and copy and paste it seven times underneath itself, as seen in Figure 6-16. Change the
android:text parameters to point to, or to reference, the tag name variables that you
created in Figure 6-12 so that the TextView objects use the correct label data value. Leave the
android:layout_width and android:layout_height set to wrap_content.

Free download pdf