Relative layout, relative layout of android

Source: Internet
Author: User

Relative layout, relative layout of android

RelativeLayout is a control placement method. By specifying the relative position between the current control and the sibling control or the parent control, you can reach the control position.

 

Common attributes of the first group relative layout:

Layout_below, layout_abve, layout_toLeftOf, layout_toRightOf

The value of the four attributes is the id of another control. Layout_toLeftOf is used to align the right of the current control to the left of the id control. The same is true for layout_toRightOf.

 

Common attributes of the second group relative layout:

Layout_alignLeft, layout_alignRight, layout_alignTop, layout_alignButtom, layout_alignBaseline

Five attributes are used for alignleft of the current widget to the left of the widget with the specified id, for example, android: layout_alignRight = "@ id/first, the other three attributes are the same.

Baseline: a line to ensure that English letters are printed neatly

Layout_alignBaseline is used to align to the control baseline.

 

Common attributes of the third group relative layout:

Layout_alignParentLeft, layout_alignParentRight, layout_alignParentTop, and layout_alignParentBottom are used to align with the edge of the direct parent control. The value is true or flase.

 

Group 4 common relative layout attributes: Used to align to the center of the parent Control

Layout_centerInParent

Layout_centerHorizontal

Layout_centerHorizontal

 

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.