Android layout attributes distinguish three --Android fill_parent, wrap_content match_parent and are sized to accommodate horizontal or vertical view, a view of the size or content-based ratio of fine layout

Difference android layout --Android fill_parent, wrap_content and the match_parent

Three attributes are used to accommodate the size of the vertical or horizontal view, or the size of a content-based layout view is more convenient than precisely specify the view range.

1)fill_parent

A member disposed layout for fill_parent member to forcibly expand to fill the space as much as a layout unit. This is broadly consistent with dockstyle Properties Windows control. Set a top layout or control is mandatory fill_parent it fills the entire screen.

2) wrap_content

Setting a size of the view wrap_content will forcibly expanded to display the full view of the contents. TextView and ImageView to control, for example, is set to wrap_content the full text and images of its interior. Change the size of the layout elements based on the content. Setting a size of the view wrap_content disposed substantially equivalent to Windows controls Autosize property to True.

. 3) match_parent
   Android2.2 in match_parent and fill_parent is a meaning. Meaning as two parameters, match_parent more appropriate, then the first two words from 2.2 can be used. So if we consider the use of low version you will need to use the fill_parent

Published 25 original articles · won praise 4 · views 20000 +

Guess you like

Origin blog.csdn.net/zhou8400/article/details/75570651