Rabbit-five la s in Android and five la s in android

Source: Internet
Author: User

Rabbit-five la s in Android and five la s in android

LinearLayout: called linear layout, which is divided into horizontal and vertical. It sets vertical or horizontal attribute values to arrange all child elements. All child elements are stacked behind other elements, so each row in a vertical list only has one element, no matter how wide they are, A horizontal list only has one row height (the height is the height of the highest child element plus the border height ). LinearLayout maintains the interval and alignment between child elements (right, middle, or left ).

FrameLayout: it is called a frame layout. You can reserve spaces on the screen before filling in a single object. For example, a picture you want to publish. All child elements are fixed in the upper left corner of the screen. You cannot specify a position for a child element in FrameLayout. The next child element directly overwrites the previous child element and blocks them in part or whole (unless the last child element is transparent ).

RelativeLayout: relative layout. You can specify the position of an element relative to other elements. You can use layout_below = "relative control ". Two elements can be arranged in the right alignment, up or down, or in the center of the screen. Elements are arranged in order. Therefore, if the first element is in the center of the screen, other elements relative to the element are arranged in the relative position in the center of the screen. If you use XML to specify this layout, the associated elements must be defined before you define it.

TableLayout: table layout. It assigns the positions of child elements to rows or columns. A TableLayout consists of many TableRow. Each TableRow defines a row (in fact, you can define other sub-objects, which will be explained below ). The TableLayout container does not display the border lines of row, cloumns, or cell. Each row has 0 or more cells, and each cell has one View object. A table consists of columns and rows in multiple cells. The table allows cells to be empty. Cells cannot span columns, which is different from HTML.

AbsoluteLayout: coordinate layout. You can set the x and y coordinates for the corresponding controls (0, 0) to the upper left corner. When you move down or to the right, the coordinate value will increase. AbsoluteLayout has no page border and allows elements to overlap with each other (although not recommended ). We generally do not recommend AbsoluteLayout unless you have a legitimate reason to use it, because it makes the interface code too rigid, so that it can work well on different devices.

Related Article

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.