问题描述
我对两个XML特性有点糊涂: match_parent
和 FILL_PARENT
。似乎都是相同的。他们之间有什么区别呢?
I'm a little confused about two XML properties: match_parent
and fill_parent
. It seems that both are the same. Is there any difference between them?
推荐答案
他们是同样的事情(在API级别8 +)。使用 match_parent
。
They're the same thing (in API Level 8+). Use match_parent
.
FILL_PARENT(改名MATCH_PARENT在API级别8或更高),这意味着视图想要成为大如其父(减去填充)
...
FILL_PARENT
:视图应象大作为它的父(减去填充)。此常数德precated从API级别8日起,代之以 match_parent
。
fill_parent
: The view should be as big as its parent (minus padding). This constant is deprecated starting from API Level 8 and is replaced by match_parent
.
http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html
这篇关于match_parent和FILL_PARENT之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!