Android Layout property values Fill_parent and Match_parent

Source: Internet
Author: User

Android Layout property values Fill_parent and Match_parent-the days of the online bubble

When writing XML, if we want a control to be covered with the parent container, we can set the value of Layout_width and layout_height to Fill_parent or match_parent, and in the higher version, Google suggests the latter, In fact, we see a lot of applications are still used in the former, or the two mixed. In fact, there is no difference between the two in the final result, their difference is in the literal sense, in fact, from the actual effect of fill_parent, fill_parent (full container) This means that the meaning is inaccurate, for a control to use Fill_ The parent is not always able to fill the container.

Fill_parent should be the child view will occupy the space of the remaining containers, and will not overwrite the previous layout of the other view space, meaning that there is already a view in front of the space has been allocated (the most obvious case is android:layout_width= "30dip" This type), the front view is not covered by the view behind the fill_parent, of course, there is no space for the layout sub-view is allocated, so the Fill_parent property is important for the layout order. So Google changed fill_parent to the actual effect more in line with the match_parent, said stuffed containers, plug meaning is how much space, occupy how much space.

Android Layout property values Fill_parent and Match_parent

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.