文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
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.

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载