Size, Padding and Margins
来源:互联网 发布:拼音生字软件 编辑:程序博客网 时间:2024/05/21 09:53
The size of a view is expressed with a width and a height. A view actually possess two pairs of width and height values.
The first pair is known as measured width and measured height. These dimensions define how big a view wants to be within its parent.The measured dimensions can be obtained by calling getMeasuredWidth()
and getMeasuredHeight()
.
The second pair is simply known as width and height, or sometimes drawing width and drawing height. These dimensions define the actual size of the view on screen, at drawing time and after layout. These values may, but do not have to, be different from the measured width and height. The width and height can be obtained by calling getWidth()
and getHeight()
.
To measure its dimensions, a view takes into account its padding. The padding is expressed in pixels for the left, top, right and bottom parts of the view. Padding can be used to offset the content of the view by a specific number of pixels. For instance, a left padding of 2 will push the view's content by 2 pixels to the right of the left edge. Padding can be set using the setPadding(int, int, int, int)
method and queried by callinggetPaddingLeft()
, getPaddingTop()
, getPaddingRight()
and getPaddingBottom()
.
Even though a view can define a padding, it does not provide any support for margins. However, view groups provide such a support. Refer toViewGroup
and ViewGroup.MarginLayoutParams
for further information.
For more information about dimensions, see Dimension Values.
- Size, Padding and Margins
- difference between padding and margins
- Margins and Long Lines
- padding and layout_margin
- 支持向量机笔记(一) functional and geometric margins
- 支持向量机笔记(一) functional and geometric margins
- Padding,Kernel-size,stride关系公式
- Even though a view can define a padding, it does not provide any support for margins. However, view
- difference of padding and margin
- UVa242Stamps and Envelope Size
- Collapsing Margins
- Collapsing margins
- Collapsing Margins
- Structure Member Alignment, Padding and Data Packing
- 100%height with padding and margin
- Padding is invalid and cannot be removed
- Structure Member Alignment, Padding and Data Packing
- File size and variable capacity
- 关于request的获取项目访问路径的问题
- 七款小程序测评,让你知道它为什么还不能取代app
- 【在 MFC 框架中,OpenCV与MFC窗口绑定方法】
- js之原型哲学思想
- C++中的单例模式
- Size, Padding and Margins
- hdu—4414
- shape为textView等设置圆角
- 怎么才能算是一个重要的员工
- java 过滤 emoji 表情
- 部署IIS时,提示访问.NETFRAMEWORK文件时,拒绝访问的解决方法
- 小知识eclipse启动tomcat时遇到超时45秒的问题
- Hibernate.cfg.xml
- linux分区详解