Chinaunix首页 | 论坛 | 博客
  • 博客访问: 46652
  • 博文数量: 22
  • 博客积分: 536
  • 博客等级: 中士
  • 技术积分: 205
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-11 00:59
文章分类

全部博文(22)

文章存档

2013年(1)

2012年(5)

2011年(16)

我的朋友
最近访客

分类: Android平台

2013-07-24 18:00:13

px is one pixel. scale-independent pixels ( sp ) and density-independent pixels ( dip ) you want to use sp for font sizes and dip for everything else.

dip==dp

from here http://developer.android.com/guide/topics/resources/more-resources.html#Dimension

px
Pixels - corresponds to actual pixels on the screen.

in
Inches - based on the physical size of the screen.

mm
Millimeters - based on the physical size of the screen.

pt
Points - 1/72 of an inch based on the physical size of the screen.

dp
Density-independent Pixels - an abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi screen, so one dp is one pixel on a 160 dpi screen. The ratio of dp-to-pixel will change with the screen density, but not necessarily in direct proportion. Note: The compiler accepts both "dip" and "dp", though "dp" is more consistent with "sp".

sp
Scale-independent Pixels - this is like the dp unit, but it is also scaled by the user's font size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and user's preference.

阅读(565) | 评论(0) | 转发(0) |
0

上一篇:异或(XOR)及其妙用

下一篇:没有了

给主人留下些什么吧!~~