Android gravity attributes (Note: This attribute is a linearlayout attribute)

Source: Internet
Author: User
Value Description
Top Put the object at the top of its container, not changing its size.
Place the object on the top of the container without changing its size.
Bottom Put the object at the bottom of its container, not changing its size.
Place the object at the bottom of the container without changing its size.
Left Put the object at the left edge of its container, not changing its size.
Place the object on the left of its container without changing its size.
Right Put the object at the right edge of its container, not changing its size.
Place the object on the right of its container without changing its size.
Center_vertical Place object in the vertical center of its container, not changing its size.
Center the object vertically without changing its size.
Vertical Alignment: center alignment in the vertical direction.
Fill_vertical Grow the vertical size of the object if needed so it completely fills its container.
When necessary, increase the vertical size of the object to be fully filled with its container.
Vertical Filling
Center_horizontal Place object in the horizontal center of its container, not changing its size.
Center the object horizontally without changing its size.
Horizontal Alignment: Align horizontally to center
Fill_horizontal Grow the horizontal size of the object if needed so it completely fills its container.
When necessary, increase the horizontal size of the object to be fully filled with its container.
Horizontal Filling
Center Place the object in the center of its container in both the vertical and horizontal axis, not changing its size.
Center an object vertically without changing its size.
Fill Grow the horizontal and vertical size of the object if needed so it completely fills its container. This is the default.
When necessary, increase the horizontal and vertical size of the object to fully fill the container.
Clip_vertical Additional option that can be set to have the top and/or bottom edges of the child clipped to its container's bounds. the clip is based on the vertical gravity: a top gravity clips the bottom edge, a bottom gravity clips the top edge, and neither clips both edges.

Additional options are used to cut the content at the top and/or bottom of the object based on the container edge. based on its vertical alignment settings: when the top is aligned, the bottom is cut; when the bottom is aligned, the top is cut; in addition, the top and the bottom are cut.

Vertical crop

Clip_horizontal Additional option that can be set to have the left and/or right edges of the child clipped to its container's bounds. the clip is based on the horizontal gravity: a left gravity clips the right edge, a right gravity clips the left edge, and neither clips both edges.

Additional options are used to cut the content on the left and/or right of the object based on the container edge. based on its horizontal alignment settings: When alignment is left, the right side is cut; When alignment is right, the left side is cut; in addition, the left side and the right side are cut.

Horizontal crop

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.