展会信息港展会大全

Android 2.2 中match_parent和fill_parent是一个意思
来源:互联网   发布日期:2015-10-13 14:55:46   浏览:2304次  

导读:标题里已经把这个意思表达清楚了,两个参数意思一样,只是某大仙觉得match_parent更贴切,于是从2.2开始你两个词都可以用。那么如果考虑低版本的使用情况你就需要用fill_parent了。下面是两者相同的证据,看andr......

标题里已经把这个意思表达清楚了,两个参数意思一样,只是某大仙觉得match_parent更贴切,于是从2.2开始你两个词都可以用。那么如果考虑低版本的使用情况你就需要用fill_parent了。

下面是两者相同的证据,看android.view.ViewGroup里的静态嵌套类LayoutParams中的代码:

public static final int FILL_PARENT = -1;

/**

* Special value for the height or width requested by a View.

* MATCH_PARENT means that the view wants to be as big as its parent,

* minus the parent's padding, if any. Introduced in API Level 8.

*/

public static final int MATCH_PARENT = -1;

/**

* Special value for the height or width requested by a View.

* WRAP_CONTENT means that the view wants to be just large enough to fit

* its own internal content, taking its own padding into account.

*/

赞助本站

人工智能实验室

相关热词: ch_parent fill_parent

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港