Android fill_parent和wrap_content分析
来源:互联网 发布:mac系统全选快捷键 编辑:程序博客网 时间:2024/05/29 13:07
fill_parent设置一个顶部布局或控件强制性让它布满整个屏幕。
wrap_content布局指根据视图内部内容自动扩展以适应其大小。
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>
原文出处:http://blog.csdn.net/jumping_android/article/details/7397991
- Android fill_parent和wrap_content分析
- Android fill_parent和wrap_content分析
- Android fill_parent和wrap_content分析
- Android fill_parent和wrap_content分析
- Android fill_parent和wrap_content分析
- Android fill_parent和wrap_content分析
- Android fill_parent和wrap_content分析
- Android fill_parent和wrap_content分析
- Android fill_parent和wrap_content分析
- Android fill_parent和wrap_content分析
- Android下fill_parent/match_parent和wrap_content分析
- Android fill_parent和wrap_content分析 (转)
- Android fill_parent、wrap_content和match_parent
- Android fill_parent和wrap_content理解
- Android之fill_parent和wrap_content
- Android的fill_parent和wrap_content
- Android fill_parent、wrap_content和match_parent的区别
- Android fill_parent、wrap_content和match_parent的区别
- Ubuntu各大分支版本功能介绍及下载地址
- STM32F10X_CL
- TCP 参数
- jquery验证邮箱
- Selenium基于UI控件总结
- Android fill_parent和wrap_content分析
- iOS面试那些事
- Javascript 笔记(2)----Closure
- xcode4.6运行高德Amap(V2.0.2)官方Demo(library not found for -lMAMapKit错误解决)
- 线性表知识的总结
- OpenXml To Excel之创建文档2
- 解决CCPageTurn3D只有往左翻页的问题
- 执行力
- 总结