What is the difference between match_parent and fill_parent ?, Matchparent

Source: Internet
Author: User

What is the difference between match_parent and fill_parent ?, Matchparent


What is the difference between match_parent and fill_parent when I am working on andorid recently?

Both match_parent and fill_parent are filled with parent controls. Before android2.2 (API8), they both use fill_parent!

All new versions after API8 use match_parent;


Wrap_content is the content of the package!


What is the difference between fill_parent and match_parent in the layout file?

1) setting the layout of a component to fill_parent will forcibly extend the component to fill as much space as possible in the layout unit. This is basically the same as the dockstyle attribute of the Windows Control. Setting a top layout or control to fill_parent will forcibly overwrite the entire screen. 2) In match_parent Android2.2, match_parent and fill_parent are the same. The two parameters have the same meaning. match_parent is more appropriate, so both words can be used from 2.2. If you want to use a lower version, you need to use fill_parent.

What is the difference between fill_parent and match_parent of layout_width in android development?

Hello:
There are many answers to this question online:
In the past, there were only FILL_PARENT and WRAP_CONTENT. So what type of match_parent is? In fact, from Android 2.2, FILL_PARENT was renamed as MATCH_PARENT. From API Level 8, we can directly use MATCH_PARENT to replace FILL_PARENT. Finally, we conclude that their definitions are essentially the same as-1, I just changed an alias. It may be more accurate. For example, the final definition in the SDK is:

(1) fill_parent-1 The view shoshould be as big as its parent (minus padding). This constant is deprecated starting from API Level 8 and is replaced by match_parent.
(2) match_parent-1 The view shocould be as big as its parent (minus padding). Introduced in API Level 8.
(3) wrap_content-2 The view shocould be only big enough to enclose its content (plus padding ).

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.