Using the Graphical Layout Tool

So far, you have created layouts by typing XML. In this section, you will use the graphical layout tool. In particular, you are going to make an alternative landscape layout for CrimeFragment.

Most built-in layout classes, like LinearLayout, will automatically stretch and resize themselves and their children on rotation. Sometimes, however, the default resizing does not make the best use of the available space.

Run CriminalIntent and rotate the device to see the CrimeFragment layout in landscape orientation.

Figure 8.4  CrimeFragment in landscape mode

CrimeFragment in landscape mode

The date button becomes oddly long; it would be better if the ...

Get Android Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.