match_parent和fill_parent的区别
有网友表示对于很多工程中的MATCH_PARENT出现在layout中感到不明白,过去只有FILL_PARENT和WRAP_CONTENT那么match_parent到底是什么类型呢? 其实从Android 2.2开始FILL_PARENT改名为MATCH_PARENT ,从API Level为8开始我们可以直接用MATCH_PARENT来代替FILL_PARENT,最后Android123提醒大家,他们的定义本质是一样均为-1,只是换了个别名,可能为了更准确些,比如最终在SDK中的定义为:
fill_parent -1 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.
match_parent -1 The view should be as big as its parent (minus padding). Introduced in API Level 8.
wrap_content -2 The view should be only big enough to enclose its content (plus padding).
转:http://blog.csdn.net/junjieking/article/details/7067855
发表评论
-
资料上传备份
2012-07-02 07:28 0对付对付对付对付 -
Android-sharedUserId数据权限
2012-05-02 10:16 1445Android-sharedUserId数据权限 An ... -
Android Service学习之本地服务
2012-04-18 10:28 873转: Android Service学习之本地服务 htt ... -
Android中SQLiteOpenHelper类的onUpgrade方法的作用
2012-02-09 11:50 4603Android中SQLiteOpenHelper类的onUpg ... -
Android启动各种系统服务线程
2012-02-09 10:59 1937Android启动各种系统服务 ... -
android
2012-02-08 09:22 0Android数据库内容变化的监听 首先介绍内容监 ... -
在线升级Android应用程序的思路
2012-02-07 11:34 893在线升级Android应用程序的思路 http://www. ... -
Android数据库内容变化的监听
2012-02-07 11:31 6039Android数据库内容变化的监听 首先介绍内容监 ... -
android中的数据库操作
2012-02-07 10:50 1459android中的数据库操作 ... -
SQLiteOpenHelper类与自动升级数据库
2012-02-07 10:31 2288SQLiteOpenHelper类与自动升级数据库 S ... -
SQLite外键的实现
2012-02-07 10:30 1719SQLite外键的实现 SQLite现在的版本还不支持 ... -
Android到处都在使用的回调分析
2011-12-21 15:53 3553Android到处都在使用的回调分析 ... -
android中LayoutInflater的使用
2011-12-21 11:35 1936android中LayoutInflater的使用 ... -
SIM卡满处理流程分析
2011-12-19 15:15 1885SIM卡满处理流程分析 //框架层分析 // SMSD ... -
短信发送状态报告流程分析
2011-12-19 15:07 2397短信发送状态报告流程分析 //应用层分析: //Sms ... -
Android平台 短信接送流程剖析(含编码)
2011-12-16 15:29 3231Android平台 短信接送流程剖析(含编码) ... -
修改语言环境方法
2011-12-16 15:20 1044修改语言环境方法 private void se ... -
Android平台 短信发送流程剖析(含编码)
2011-12-12 17:12 4339Android平台 短信发送流程剖析(含编码) 本文对A ... -
Android 应用程序签名
2011-11-27 11:34 1644Android 应用程序签名 转:http://www ... -
理解Android 上的安全性
2011-11-27 11:18 1479理解 Android 上的安全性 ...
相关推荐
LinearLayoutCompat 线性布局 ...其中match_parent和fill_parent的意义相同,但官方更推荐match_parent. match_parent表示让当前控件的大小和父布局的大小一样,也就是由父布局来决定当前控件的大小 wrap_con
android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> android:id="@android:id/tabhost" android:layout_width="match_parent" android:layout_...
android:layout_width="match_parent" android:layout_height="match_parent"> android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> android:id=...
`layout_width`和`layout_height`都设置为`fill_parent`,表示占据父容器的全部宽度和高度。`orientation`属性设置为`vertical`,意味着子视图将按垂直方向排列。 在LinearLayout中,我们有一个TextView和一个...
android:layout_width="fill_parent" android:layout_height="fill_parent"> android:text="button" android:layout_width="fill_parent" android:layout_height="wrap_content" /> android:text=...
android:layout_height="match_parent"> android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <androidx.appcompat.widget.AppCompatImageView ...
android:layout_width="fill_parent" android:layout_height="wrap_content" /> android:id="@android:id/tabcontent" android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="0" ...
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_...
android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height=...
android:layout_height="match_parent"> android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> android:id="@android:id/tabs" android:layout_...
android:layout_height="match_parent"> android:id="@+id/second_button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|center_...
android:layout_width="match_parent" android:layout_height="match_parent"> android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> android:...
android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v4.view.ViewPager android:id="@ id/viewpager_default" android:layout_width="match_parent" ...
android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_vertical" android:background="@drawable/tab_background"> <!-- ...
D.match_content并不是一个有效的属性值,正确选项是A.match_parent、B.fill_parent(与match_parent同义)和C.wrap_content。 6. 资源和状态保存的最佳时机: 最好在B.onPause中保存,因为这是Activity进入后台...
android:layout_width="match_parent" android:layout_height="wrap_content" /> ``` 问题描述 当TabLayout 在宽屏幕的设备上,如平板横屏的时候,tab的宽度超过一定值后,就不在平均分配宽度,而是居中显示。...
mPopupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); mPopupWindow.setOutsideTouchable(true); // 设置外部可触摸,以便点击外部关闭 ...
android:layout_width="fill_parent" android:layout_height="fill_parent"> android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="I am textview 1" /> android:...
android:layout_height="fill_parent" android:weightSum="1"> android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> android:layout_width="match...
android:layout_width="match_parent" android:layout_height="match_parent" android:background="#F0EFF5" > android:id="@+id/sayit_rl_tab" android:layout_width="fill_parent" android:layout_...