Layout management in Android

Source: Internet
Author: User


Fill_parent: Full Screen


Wrap_content: The size is enough to show the content in the current control.


Android: gravity = "right": alignment of its child controls (gravity tendency)


Table layout <tablelayout>:


Android: collapsecolumns = "1": indicates to hide column 1 of tablerow in tablelayout, that is, the second column (number starts from 0). If multiple columns need to be hidden, separated by commas (,). Android: collapsecolumns = "0, 1"


Android: stretchcolumns = "1": sets column 1 to be stretched.


Android: shrinkcolumns = "0": sets column 0 to a column that can be shrunk.


Relative layout <relativelayout>:


Child widgets are relatively laid out based on the reference controls and parameters they have set.


Android: layout_centerinparent = "true": place the current widget in the center of its parent widget, either horizontally or vertically.


Android: layout_centerhorizontal: placed in the center of the parent Control


Android: layout_centervertical: placed in the center of the portrait of the parent Control


Android: layout_alignparentbottom: Align the bottom of the current control with the bottom of the parent Control


Android: layout_alignparentleft: Align the left end of the current control with the left end of the parent Control


Android: layout_alignparentright: Align the right end of the current control with the right end of the parent Control


Android: layout_alignparenttop: Align the top of the current control with the top of the parent Control


Android: layout_alignwithparentifmissing: when the reference control does not exist or is invisible, refer to the parent control.


The value of the preceding attribute is true or false.


----------------------------------------------------------


Android: layout_below = "@ ID/idname": place the current control under the control whose ID is idname.


Android: layout_above = "@ ID/idname": place the current control above the control whose ID is idname.


Android: layout_below = "@ ID/idname": place the current control under the control whose ID is idname.


Android: layout_toleftof = "@ ID/idname": place the current control on the left side of the control whose ID is idname.


Android: layout_torightof = "@ ID/idname": place the current control on the right side of the control whose ID is idname.

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.