match_parent 和fill_parent 有什么区别? [英] What is the difference between match_parent and fill_parent?

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

问题描述

我对两个 XML 属性有点困惑:match_parentfill_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(在 API Level 8 及更高版本中重命名为 MATCH_PARENT),这意味着视图希望与其父视图一样大(减去填充)

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:视图应该与其父视图一样大(减去填充).从 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/视图/ViewGroup.LayoutParams.html

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

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