Android-gravity and Layout_gravity differences

Source: Internet
Author: User

Gravity and Layout_gravity differences


This address: Http://blog.csdn.net/caroline_wendy


in android Control Properties in: gravity is how the contents of the control are positioned within the control; layout_gravity is how the control is positioned in its parent layout. For example: layout_ Gravity represents the EditText in the parent control, such as the root relativelayout, that is displayed in the center of the screen.
reference: http ://stackoverflow.com/questions/3482742/gravity-and-layout-gravity-on-android their names should help:

    • Android:gravity sets the gravity of the content of the View its used on.
    • Android:layout_gravity sets the gravity of the View or layout in its parent.
And an example are here .

Android-gravity and Layout_gravity differences

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.