Android Relative layout relativelayout each property introduction

Source: Internet
Author: User

Android Relative Layout Relativelayout description of each property

Relative to the sibling element
android:layout_below= "@id/xxx": Below the specified view
Android:layout_above= "@id/xxx": Above the specified view
android:layout_toleftof= "@id/xxx": On the left side of the specified view
android:layout_torightof= "@id/xxx": On the right side of the specified view
Relative to Parent element
Android:layout_alignparentleft= "true": Left inside the parent element
Android:layout_alignparentright= "true": inside the parent element to the right
Android:layout_alignparenttop= "true": top of parent element inside
Android:layout_alignparentbottom= "true": inside the parent element at the bottom
Alignment
Android:layout_centerinparent= "true": Center layout
Android:layout_centervertical= "true": Horizontal Center layout
Android:layout_centerhorizontal= "true": Vertical Center Layout
android:layout_aligntop= "@id/xxx": consistent with the upper border of the specified view
android:layout_alignbottom= "@id/xxx": Consistent with specified view lower bounds
android:layout_alignleft= "@id/xxx": Consistent with the left edge of the specified view
android:layout_alignright= "@id/xxx": Consistent with the right edge of the specified view
Interval
Android:layout_marginbottom= ""; The distance from the bottom edge of an element
Android:layout_marginleft= ""; The distance from the left edge of an element
Android:layout_marginright = ""; The distance from the right edge of an element
Android:layout_margintop= ""; The distance from the top edge of an element
Android:layout_paddingbottom= ""; The distance from the bottom edge of the parent element
Android:layout_paddingleft= ""; The distance from the left edge of the parent element
Android:layout_paddingright = ""; The distance from the right edge of the parent element
Android:layout_paddingtop= ""; Distance from top edge of parent element

On the difference between margin and padding
Padding is the angle of the parent view that describes the problem, and is the distance between itself and the edge of its parent control. Margin is to stand in their own perspective to describe the problem, and the distance from the side of a component, if there is only one view at the same level, then its effect is basically the same as padding.

650) this.width=650; "src=" Http://images0.cnblogs.com/blog2015/677694/201506/222248132209266.png "/>


Android Relative layout relativelayout each property introduction

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.