文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>[Android 資訊] Differences of px, sp, pt, dip, dp, in, and mm?

[Android 資訊] Differences of px, sp, pt, dip, dp, in, and mm?

时间:2010-12-24  来源:FANTAISIE

It's an issue we will meet - what are the difference of px, sp, pt, dip, dp, in, and mm? 

 

Here are the definitions:

 

px - Pixel

Independent points from devices corresponding to actual pixels on the screen. (e.g. HVGA: 320x480)

 

pt
Points - 1/72 of an inch

 

dip - Density-independent Pixel
It's an abstract unit that is based on the physical density relative to a 160 dpi screen. That is to say, one "dp" is one "px" on a 160 dpi screen. The ratio of dp-to-pixel changes with the screen density. Note: The compiler accepts both "dip" and "dp", though "dp" is more consistent with "sp".

 

dp 

Compiler recognize it as "dip".

 

sp - Scale-independent Pixel

It acts like an "dp" unit, but it can be also scaled by the user's font size preference that will be adjusted for both the screen density and preference.

It is recommend when trying specifying font sizes,

 

in -Inch

The size that is based on the physical size of the screen.

 

mm -Millimeter

The size that is based on the physical size of the screen.

相关阅读 更多 +
排行榜 更多 +
僵尸运行3d城市逃生

僵尸运行3d城市逃生

冒险解谜 下载
顶尖猎人罗迪和凯茜

顶尖猎人罗迪和凯茜

冒险解谜 下载
火柴人飞爪忍者

火柴人飞爪忍者

冒险解谜 下载