December 2013
Beginner
416 pages
12h 45m
English
If you open the On Your Bike app and rotate the device, you will see that when it is in landscape mode, the buttons are too large. You can check this by switching to Graphical Layout and then switching to Landscape mode in the emulator.
Let’s create a landscape layout by using the land qualifier.
1. Create a new res/layout-land directory. Copy the existing activity_timer.xml file from res/layout into this directory.
2. Change android:layout_width from match_parent to wrap_content. Add a new attribute, android:minWidth, with a value of 420dp (see Listing 6.4).
Listing 6.4 Setting the Layout Attributes
<LinearLayout android:layout_width="wrap_content" android:layout_height ...
Read now
Unlock full access