在android系统FILL_PARENT和match_parent区别 [英] difference between fill_parent and match_parent in android

查看:113
本文介绍了在android系统FILL_PARENT和match_parent区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  <一href=\"http://stackoverflow.com/questions/5761960/what-is-the-difference-between-match-parent-and-fill-parent-property-in-android\">what采用的是Android 结果match_parent和FILL_PARENT属性之间的区别
   FILL_PARENT和MATCH_PARENT

Possible Duplicate:
what is the difference between match_parent and fill_parent property in android
FILL_PARENT and MATCH_PARENT

我通过Android开发者网站,他们给以下区别:

I have go through android developer site where they give following difference :

请注意:与Android 2.2(API 8级)开始,FILL_PARENT已更名为match_parent,以更好地反映行为。原因是,如果设置一个以FILL_PARENT不扩大同级的观点被认为是后补的剩余空间,而是扩展到父视图的大小,不管是什么,它​​就会重叠任何兄弟姐妹意见一致。

Note: Beginning with Android 2.2 (API level 8), "fill_parent" has been renamed "match_parent" to better reflect the behavior. The reason is that if you set a view to "fill_parent" it does not expand to fill the remaining space after sibling views are considered, but instead expands to match the size of the parent view no matter what—it will overlap any sibling views.

但任何与example.so,事情可能会清除解释。

But anyone explain with example.so that things may clear.

推荐答案

他们是同样的事情(在API级别的 8 + )。使用match_parent。

They're the same thing (in API Level 8+). Use match_parent.

FILL_PARENT (改名 MATCH_PARENT 在API级别的 8 和更高),这意味着该视图想成为大如其父(负填充)

fill_parent (renamed MATCH_PARENT in API Level 8 and higher), which means that the view wants to be as big as its parent (minus padding)

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

有关Android的API的 1.6 ,即可在这些情况下的 2.1 match_parent 将抛出你一个错误,所以使用FILL_PARENT。为支持向后兼容性,最好使用 FILL_PARENT

For Android API 1.6 to 2.1 match_parent will throw you an error, so use fill_parent in these cases. To support backward compatibility, it's better to use fill_parent

我记得罗马盖伊(Android开发者在谷歌)说,因为FILL_PARENT混淆了开发者,他们已经改变了名称。由于事实事,FILL_PARENT不填充剩余空间(即使用权重属性),但它需要尽可能多的空间作为其布局父。这就是为什么新的名称是match_parent

I remember that Roman Guy (Android Developer at Google) said, that 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"

这篇关于在android系统FILL_PARENT和match_parent区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆