Summary of layouts in Android

Source: Internet
Author: User

1, LinearLayout

Android:gravity is the position of the element that adjusts the contents of the elements themselves or the elements that contain them, which are displayed by default on the left side

Android:layout_gravity is relative to its parent element, stating where the element appears in the parent element.

A/linearlayout:vertical

LinearLayout gravity can control the upper and lower positions of sub-view: Bottom, Center,top
Sub view: Layout_gravity Only the horizontal setting will work, and the vertical setting will not work. That is: The left,right,center_horizontal is in force.
Together, the two parameters control the position of the child view in the LinearLayout.

B/linearlayout:hor


 
Sub view: Layout_gravity Only the vertical setting will work, and the horizontal setting will not work. That is: The top,bottom,center_vertical is in force.

Summary of layouts in Android

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.