<! -- @ Page {margin: 2 cm} P {margin-bottom: 0.21} -->
The layout-land and layout-port directories are mainly used to save files in the application's interface layout. Layout-land is the layout setting for horizontal screen display on the android application interface, and layout-port is the layout setting for vertical screen display on the android Application Interface. Because of these two types of display, the display ratio of the application is different. Therefore, the application needs to be re-arranged based on different proportions, so you cannot simply scale the display. Otherwise, the interface is not easy to use, the screen space is not maximized. Originally, the screen of a mobile phone is a very small display. If you do not try to use it as much as possible, it will certainly not meet your needs. Of course, the two display methods can also maximize the sharing of the same images, strings, and other resources.
In the layout-land directory, there are two files:
Main. xml and history_item.xml
Next, you can see the content of the main. xml file as follows:
<? Xml version = "1.0" encoding = "UTF-8"?>
This line describes the XML version and encoding format.
<! --
/*
* Copyright (C) 2008, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License ");
* You may not use this file before t in compliance with the License.
* You may obtain a copy of the License
*
* Http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* Distributed under the License is distributed on an "as is" BASIS,
* Without warranties or conditions of any kind, either express or implied.
* See the License for the specific language governing permissions and
* Limitations under the License.
*/
-->
<LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android"
Android: orientation = "vertical"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
Android: background = "# ff000000">
In the android application interface, there are five main layout modes: FrameLayout, LinearLayout, AbsoluteLayout, and RelativeLayout ), table layout (TableLayout ).
Here we mainly use LinearLayout. What are the characteristics of this layout? As the name implies, the interface elements are arranged linearly. For example, if a row has 10 text display boxes, and a row is horizontally arranged, if the screen is not big enough, the elements behind it cannot be displayed. For vertical layout, each line is displayed in a text box with 10 lines. In a linear layout, if the layout mode is not specified, the layout is arranged horizontally by default. Of course, the linear layout can also be nested to display multi-row sub-elements, but it is difficult to maintain this, and the relative layout (RelativeLayout) should be used for implementation, which is more convenient.