Android layout manager (linear layout) and android Layout

Source: Internet
Author: User

Android layout manager (linear layout) and android Layout

Linear layout is represented by the LinearLayout class. The linear layout of Android is a bit similar to the Box of Swing (they all sort the components in the container one by one). In LinearLayout, android is used: orientation attributes control whether the layout is horizontal or vertical (vertical horizontal, horizontal vertical)

XMLAttribute

Related Methods

Description

Android: baselineAligned

SetBaselineAligned (boolean)

If this attribute is set to false, the layout manager and its child elements are blocked from baseline

Android: divider

SetDividerDrawable (Drawable)

Vertical layout of split bars between two split buttons

Android: gravity

SetGravity (int)

Sets the alignment of components in the layout manager. The attributes include top, left, right, center_vertical, and fill_vertical.

Android: measureWithLargestChild

SetMeasureWithLargestChildEnabled (boolean)

When this attribute is set to true, all child elements with weight will have the minimum size of the Maximum child element.

Android: orientation

SetOrientation (int)

Set the alignment of components in the layout manager, horizontal: horizontal, vertical: vertical

 

Common XML attributes of LinearLayout child elements

XMLAttribute

Related Methods

Description

Android: layout_gravity

 

Specifies the alignment of the child element in LinearLayout.

Android: layout_weight

 

Specify the weight of the child element in LinearLayout.

Specific attribute effects:

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.