Android Training Course (45)

Source: Internet
Author: User

<! -- @ Page {margin: 2 cm} P {margin-bottom: 0.21} A: link {so-language: zxx} -->

The frame layout (FrameLayout) is used to display the screen as a whole each time, and starts from the upper left corner. However, this method has a problem called the display order, that is, the first display layer must be at the bottom layer, and the last display is at the last layer. If each layer is left blank in the upper left corner, it will be the same as the stacked mode in Windows. In this way, the stack type is used to save elements. During display, the stack type is also required.

 

The absolute layout (AbsoluteLayout) method treats the screen as a two-dimensional coordinate. in this plane, each element specifies a coordinate value relative to the upper left corner. When you need to change the interface, update the absolute coordinates of all elements once. When setting an application to adapt to different mobile phones, you need to set the coordinates of each element based on different screens. This is a fairly maintained method and should be replaced by other methods as much as possible.

 

The relative layout (RelativeLayout) method is to determine the position of the child element relative to the parent element or other element. In this way, when the interface is released and changed, you only need to change the location of the parent element or some elements, you can change the overall interface layout for easy maintenance.


// QQ: 9073204 EMAIL: 9073204@qq.com

// Cai junsheng


In TableLayout mode, the screen is regarded as a two-dimensional table, and elements are arranged in rows and columns.

Let's look at the attributes of thread layout. It mainly describes what kind of things. All linear layout nodes start with LinearLayout:

Xmlns: android attribute specifies the XML Attribute Interpretation standard;

Android: orientation: whether the linear layout is horizontal or vertical;

Android: layout_width is the linear layout width. Generally, there are two options: fill_parent is to fill the entire screen, and wrap_content is only suitable for displaying content.

Android: layout_height is the height, which is the same as the width above.

Android: background is the background color settings.

 

You can set the direction, width, height, and background color of the Interface Element arrangement through the above items.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.