AlanSTACK
AlanSTACK

Reputation: 6065

Does match_parent make it same as parent, or just fill remaining space?

Just to clarify some misconception.

But is Android's match_parent property making the target view just filling the rest of the parent's available space,

or is it literally "matching parent" regardless of whether or not doing so will overflow the screen

Upvotes: 0

Views: 31

Answers (1)

natario
natario

Reputation: 25194

Strictly speaking, the behavior of layout_* params like layout_height and layout_width depends on how the parent ViewGroup decides to handle them. You might create a view group that ignores match_parent, for instance.

Practically, it is common for match_parent to mean match the parent dimension. Regardless of whether doing so will overflow the screen.

Upvotes: 1

Related Questions