CHAPTER 6: Android Screen Design: Writing to the Display Using Activity and View 195
The reason you can’t see the second
structure android:layout_width and android:layout_height parameters set to use the match_parent
constant.
What this match_parent constant tells Android to do for both the width (X axis) and height
(Y axis) dimensions of the layout container is to expand the layout container to fill the UI layout
container “above” it in the display hierarchy. For the first parent
to fill the device display screen, which is what we want, and you can see by the background
image filling the screen (once we removed the margins) that this is working as desired. The first
nested
to be changed to a constant that tells it not to fill the screen, which is where the wrap_content
constant comes in.
Figure 6-26. Change child LinearLayout width and height constants to wrap_content; center hello_world TextView