XML attributes Fill_parent, warp_content, match_parent differences in Android

Source: Internet
Author: User

Fill_parent:

Specifies the height of the subassembly, the width of the parent container's height, and the same size (in fact, the distance from the padding is subtracted).

Setting the layout of a component to fill_parent will force the component to expand to fill as much space as possible within the layout unit. This is roughly the same as the DockStyle property of Windows controls. Setting a top layout or control for Fill_parent will force it to fill the entire screen.

Wrap_content:

The size of the subassembly can be wrapped around the contents of the child control, relative to the contents of the applies control, while the other two are for the parent control.


Match_parent:

This property is exactly the same as fill_parent, and it is recommended to use the Match_parent attribute in place of the Fill_parent attribute starting from Android2.2.


about the properties of the control's margins:

XML attributes Fill_parent, warp_content, match_parent differences 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.