fill_parent--wrap_content
来源:互联网 发布:查看淘宝店铺信誉等级 编辑:程序博客网 时间:2024/06/16 14:13
1)fill_parent
设置一个构件的布局为fill_parent将强制性地使构件扩展,以填充布局单元内尽可能多的空间。这跟Windows控件的dockstyle属性大体一致。设置一个顶部布局或控件为fill_parent将强制性让它布满整个屏幕。
2) wrap_content
设置一个视图的尺寸为wrap_content将强制性地使视图扩展以显示全部内容。以TextView和ImageView控件为例,设置为wrap_content将完整显示其内部的文本和图像。布局元素将根据内容更改大小。设置一个视图的尺寸为wrap_content大体等同于设置Windows控件的Autosize属性为True。
3)match_parent
1. wrap_content
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Button
android:id="@+id/btnButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button CJP"/>
</RelativeLayout>
2. fill_parent – width
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Button
android:id="@+id/btnButton1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button CJP"/>
</RelativeLayout>
3. fill_parent – height
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Button
android:id="@+id/btnButton1"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="Button CJP"/>
</RelativeLayout>
4. fill_parent – width, height
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Button
android:id="@+id/btnButton1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Button CJP"/>
</RelativeLayout>
0 0
- fill_parent--wrap_content
- fill_parent和wrap_content
- wrap_content 和fill_parent
- fill_parent、wrap_content和match_parent
- Android:wrap_content fill_parent match_parent
- wrap_content和match_parent/fill_parent
- fill_parent/match_parent/wrap_content区别
- fill_parent与wrap_content的区别
- fill_parent和wrap_content的区别
- Android fill_parent和wrap_content分析
- fill_parent和wrap_content的区别
- Android fill_parent和wrap_content分析
- fill_parent和wrap_content的区别
- Android fill_parent和wrap_content分析
- fill_parent和wrap_content的区别
- Android fill_parent和wrap_content分析
- Android fill_parent和wrap_content分析
- Android Wrap_content And Fill_parent Example
- 冒泡排序 --学习(二)
- Linux I/O Scheduler--CFQ
- php对象属性读写
- linux基础命令学习笔记
- Android Dialog用法
- fill_parent--wrap_content
- opencv轮廓的简单应用
- 对象标准COM和CORBA论长道短
- php定义接口
- 十步完全理解SQL
- 待验证
- 关于调用Appwidget的一点事
- php源码解析:继承与实现接口
- 回归相关博文