Android Growth Diary-five big layouts

Source: Internet
Author: User

1. Five layout of the linear layout linearlayout

Feature: The child controls it contains are arranged in a horizontal or vertical manner

Ps:android:gravity= "Center|bottom" (gravity allows multistage joint use)

TIP: Note the following examples:

<button

Android:layout_weight= "2"

android:layout_height= "wrap_parent"

Android:layout_width= "match_parent"/>

<button

android:layout_weight= "1"

android:layout_height= "wrap_parent"

Android:layout_width= " match _parent"/>[S1]

=====================================================

<button

Android:layout_weight= "2"

android:layout_height= "match_parent"

Android:layout_width= "match_parent"/>

<button

android:layout_weight= "1"

android:layout_height= "match_parent"

Android:layout_width= "match_parent"/>[s2]

========================================================

2. The relative layout of the five layout relativelayout

Feature: The child controls it contains are arranged in a relative position between controls or as a subclass control relative to the position of the parent class container

Ps:

========================================================

3. Five layout frame layout framelayout

Features: In this layout, all the child elements cannot be placed in the position, they are all placed in the upper left corner of the area, and the following child elements directly over the preceding child elements, the front of the child elements of the partial and total occlusion.

Eg: Setting the effect of similar progress bar through Framelayout

===============================================

4. Five layout of the absolute layout absolutelayout

Features: Also named coordinate layout, you can directly specify the absolute position of the child element (XY)

Disadvantage: Because the mobile phone screen size differences, the use of absolute positioning adaptability will be poor, on the screen of the adaptation of the defective

5. Five layout of the table layout tablelayout

Features: Tablelayout table layout Model manages child controls in the form of rows and columns, each of which behaves as a TableRow object, but can also be a view object

------------------------------------------------------------

----------------------------------------------------------

Collapsecolumns is set to hidden, Shrinkcolumns is set to shrink, Stretchcolumns is set padding blank. The Tablelaout column is counted starting from 0

[S1] in this case, the top Button space-occupying 2/3 , the following Button accounted for 1/3

[S2] in this case, the top Button accounted for 1/3 , the following Button accounted for 2/3

Android Growth Diary-five big layouts

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.