【layout】fill_parent和wrap_content的区别
来源:互联网 发布:网络安全技术与实践 编辑:程序博客网 时间:2024/05/01 18:51
Either attribute can be applied to View's (visual control) horizontal or vertical size. It's used to set a View or Layouts size based on either it's contents or the size of it's parent layout rather than explicitly specifying a dimension.
两个属性都用来适应视图的水平或垂直大小,一个以视图的内容或尺寸为基础的布局比精确地指定视图范围更加方便。
设置一个构件的布局为fill_parent将强制性地使构件扩展,以填充布局单元内尽可能多的空间。这跟Windows控件的dockstyle属性大体一致。
Setting a top level layout or control to fill_parent will force it to take up the whole screen.
设置一个顶部布局或控件为fill_parent将强制性让它布满整个屏幕。
wrap_content
Setting a View's size to wrap_content will force it to expand only far enough to contain the values (or child controls) it contains. For controls -- like text boxes (TextView) or images (ImageView) -- this will wrap the text or image being shown. For layout elements it will resize the layout to fit the controls / layouts added as its children.
设置一个视图的尺寸为wrap_content将强制性地使视图扩展以显示全部内容。以TextView和ImageView控件为例,设置为wrap_content将完整显示其内部的文本和图像。布局元素将根据内容更改大小。
It's roughly the equivalent of setting a Windows Form Control's Autosize property to True.
设置一个视图的尺寸为wrap_content大体等同于设置Windows控件的Autosize属性为True。
简言之:fill_parent布局指将视图(在Windows中称为控件)扩展以填充所在容器的全部空间。
wrap_content布局指根据视图内部内容自动扩展以适应其大小。
两个属性都用来适应视图的水平或垂直大小,一个以视图的内容或尺寸为基础的布局比精确地指定视图范围更加方便。
fill_parent
设置一个构件的布局为fill_parent将强制性地使构件扩展,以填充布局单元内尽可能多的空间。这跟Windows控件的dockstyle属性大体一致。
Setting a top level layout or control to fill_parent will force it to take up the whole screen.
设置一个顶部布局或控件为fill_parent将强制性让它布满整个屏幕。
wrap_content
Setting a View's size to wrap_content will force it to expand only far enough to contain the values (or child controls) it contains. For controls -- like text boxes (TextView) or images (ImageView) -- this will wrap the text or image being shown. For layout elements it will resize the layout to fit the controls / layouts added as its children.
设置一个视图的尺寸为wrap_content将强制性地使视图扩展以显示全部内容。以TextView和ImageView控件为例,设置为wrap_content将完整显示其内部的文本和图像。布局元素将根据内容更改大小。
It's roughly the equivalent of setting a Windows Form Control's Autosize property to True.
设置一个视图的尺寸为wrap_content大体等同于设置Windows控件的Autosize属性为True。
简言之:fill_parent布局指将视图(在Windows中称为控件)扩展以填充所在容器的全部空间。
wrap_content布局指根据视图内部内容自动扩展以适应其大小。
0 0
- 【layout】fill_parent和wrap_content的区别
- fill_parent和wrap_content的区别
- fill_parent和wrap_content的区别
- fill_parent和wrap_content的区别
- fill_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和match_parent的区别
- Android fill_parent、wrap_content和match_parent的区别
- (一) fill_parent和wrap_content的区别
- Android fill_parent、wrap_content和match_parent的区别
- Android fill_parent、wrap_content和match_parent的区别
- Android fill_parent、wrap_content和match_parent的区别
- Android fill_parent、wrap_content和match_parent的区别
- Android fill_parent、wrap_content和match_parent的区别
- Android fill_parent、wrap_content和match_parent的区别
- java开发环境配置
- 第15章:数字,字符串和集合
- Ceph-Openstack学习笔记
- ubuntu13.10 安装rpm包
- 第九届湖南省ACM—ICPC程序设计大赛 搞笑版费马大定理
- 【layout】fill_parent和wrap_content的区别
- open/read/write和fopen/fread/fwrite的区别
- C# 获取窗口句柄并且关闭应用程序
- gcc 和g++编译选项详解
- usc@1002:项目投标
- Jogl2.0 jogamp-all-platforms 在eclipse 中的配置
- linux中nginx安装,自己安装成功了
- Linux中Grep常用的15个例子
- 一步步学习微软InfoPath2010和SP2010--第十一章节--创建批准流程(1)--收集需求