A (175)

(Tuis.) #1
CHAPTER 8: Android UI Design: Using Advanced ViewGroup Layout Containers 281

android:id="@+id/edit_fleet" android:hint="@string/hint_fleet" android:layout_row="2"
android:textColor="#FFFFFF" android:textColorHint="#FFFFFF" android:layout_column="0" />
<EditText android:layout_width="wrap_content" android:layout_height="wrap_content"
android:id="@+id/edit_ships" android:hint="@string/hint_ships" android:layout_row="3"
android:textColor="#FFFFFF" android:textColorHint="#FFFFFF" android:layout_column="0" />
<Button android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_column="1" android:layout_row="0" android:id="@+id/submit_colony"
android:text="@string/ok_button" android:textColor="#FFFFFF" />
<Button android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_column="1" android:layout_row="1" android:id="@+id/submit_pop"
android:text="@string/ok_button" android:textColor="#FFFFFF" />
<Button android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_column="1" android:layout_row="2" android:id="@+id/submit_fleet"
android:text="@string/ok_button" android:textColor="#FFFFFF" />
<Button android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_column="1" android:layout_row="3" android:id="@+id/submit_ships"
android:text="@string/ok_button" android:textColor="#FFFFFF" />



The final XML markup is shown in Figure 8-14, and replicates the Edit Galaxy Information UI design
that you created by using a RelativeLayout class in the previous chapter. If you want to see a screen
shot of what the final design should look like, take a look at Figure 8-11. Now we need to take a
closer look at those other major parameters that I outlined in Tables 8-1 and 8-2, including the
layout_gravity and the concept of cell spanning.


Figure 8-14. The XML markup which will replicate the RelativeLayout UI design using a GridLayout tag

Free download pdf