Android common layout and usage scenarios

Source: Internet
Author: User

Commonly used there are three kinds of linearlayout linear layouts relativelayout relative layout framelayout frame layout

Characteristics:

LinearLayout Linear Layout--1, default is horizontal layout "Horizontal" can be set to "vertical" vertical layout

2, very organized, write out the layout is more intuitive, suitable for simple page layout

Disadvantages--horizontal and vertical, not arbitrarily set

Relativelayout relative Layout--1. The default location is the upper-right corner of the screen, which can be superimposed

2. You can set the location, customize the position of the control

Disadvantages--When you set the control position, you must have an ID to position the relative positions between the two controls

Framelayout Frame Layout--1. One layer at a later

Disadvantages--No two controls at the same level

Usage scenario: When the page has a time-consuming operation, you can add a frame layout to the outer layer, the display visibility property in the load is visible, and then when the operation is finished, the page visibility property that is displayed in the load is set to invisible invisible

Horizontal and relative layouts can be used simultaneously when a page needs to have a more cluttered distribution and a coherent distribution

        

    The important thing is to ingenious

Android common layout and usage scenarios

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.