是去precated字FILL_PARENT和match_parent之间的唯一区别 [英] Is deprecated word the only difference between fill_parent and match_parent
问题描述
我发现这两个 FILL_PARENT
和 match_parent
意味着同样的事情
I found both fill_parent
and match_parent
means the same thing
- FILL_PARENT 意味着视图想要成为大如其父,减去母公司的填充,如果有的话。
- match_parent 意味着视图想要成为大如其父,减去母公司的填充,如果有的话。
- fill_parent means that the view wants to be as big as its parent, minus the parent's padding, if any.
- match_parent means that the view wants to be as big as its parent, minus the parent's padding, if any.
只有一个区别,我发现这是 FILL_PARENT
是德precated从API级别8日起,代之以 match_parent
Only One difference I found that is fill_parent
is deprecated starting from API Level 8 and is replaced by match_parent
不过,在创建布局,我没有注意到这两者之间有什么区别。如果两者是相同的,为什么FILL_PARENT是德precated。任何人都可以表明,这两种或FILL_PARENT和WRAP_CONTENT之间的任何区别,除了去precated字之间的实际差异。
But while creating layout I didn't notice any difference between these two. If both are the same then why fill_parent is deprecated. Can anyone show any practical difference between these two or any other difference between fill_parent and wrap_content except deprecated word.
我已经通过<一个了href="http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html">http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html
推荐答案
至于你说他们是完全一样的。正如罗曼·盖伊说,他们已经改变了名字,因为FILL_PARENT
混淆了开发人员。作为事实事,FILL_PARENT
不填充剩余空间(即使用权重属性),但它需要尽可能多的空间作为其布局父。这就是为什么新的名为match_parent
。
As you said they are exact the same. As Romain Guy said, they have changed the name because "fill_parent"
was confusing for developers. As matter of the fact, "fill_parent"
does not fill the remaining space (for that you use the weight attribute) but it takes as much space as its layout parent. That's why the new name is "match_parent"
.
这篇关于是去precated字FILL_PARENT和match_parent之间的唯一区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!