px(像素):屏幕上的点。
sp(与刻度无关的像素):与dp类似,但是可以根据用户的字体大小首选项进行缩放。
dip 与dp相同,多用于Google示例中。
dp(与密度无关的像素):一种基于屏幕密度的抽象单位。在每英寸160点的显示器上,1dp = 1px。

解决方案 »

  1.   

    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 ration of dp-to-pixel will change with the screen density, but not necessarily directly; instead the ratio is selected is something that is close to the screen.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.