Elaborate on the development history of Google Android Frame Layout

Source: Internet
Author: User

With the development of the progressive technology of the times, FrameLayout has also been rapidly upgraded and upgraded. Next, I will describe FrameLayout before and after the upgrade, I found some related solutions on relevant forums and shared them for mutual learning and communication.

FrameLayout is the simplest layout object. It is customized as a blank standby area on your screen, and then you can fill in a single object-for example, an image 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 will overwrite and fill the previous child element, and block them in part or whole unless the last child element is transparent ). LinearLayout lists all child elements based on the vertical or horizontal attribute values you set for it.

All child elements are stacked behind other elements, so each row in a vertical list has only one element. Regardless of how wide they are, a horizontal list will have only one row height to the height of the highest child element plus the border height ). LinearLayout maintains the interval between sub-elements and the right, middle, or left alignment of each element ).

LinearLayout also supports specifying weight for individual child elements. The advantage is that it allows sub-elements to fill the remaining space on the screen. This also avoids a large screen where a bunch of small objects are crowded into a pile. Instead, they are allowed to zoom in and fill the white space. When a child element specifies a weight value, the remaining space is allocated to the child elements according to the weight ratio specified by the child elements.

The default weight value is 0. For example, if there are three text boxes, two of which specify the weight value as 1, the two text boxes will be scaled up proportionally and fill up the remaining space, the third text box is not enlarged. The following two forms use LinearLayout, which contains a group of elements: one button, several labels, and several text boxes. Both forms are modified for the layout.

The width of the text box is set to FILL_PARENT; the width of other elements is set to WRAP_CONTENT. The default alignment mode is left alignment. Weight is not set on the left. The default value is 0); weight is set to 1 in the comments text box on the right. If the Name text box is also set to 1, the Name and Comments text boxes will have the same height.

In a horizontally arranged FrameLayout, each item sorts the elements of the first row of the first column by their text baseline, that is, the top or leftmost, Which is set as the reference baseline ). Therefore, when people search for elements in a window, they do not need to read the text of the elements on top or bottom. You can set android: baselineAligned = "false" in layout XML to disable this setting.

TableLayout distributes the positions of child elements to rows or columns. A TableLayout in android 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. A TableLayout is displayed, and the dotted lines in the figure represent invisible cell borders.

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.