android中分辨率和屏幕密度的区别是?[

解决方案 »

  1.   

    Android屏幕密度(Density)和分辨率的解释
    http://blog.csdn.net/sakura41/archive/2010/07/02/5709291.aspx
      

  2.   

    建议去看下doc中,DisplayMetrics的章节。假设分辨率是 x*y, 密度为 d, 屏幕实际大小为  a*b那么关系为   x*y = d * a * b (是约等于,不会打约等于号)The logical density of the display. This is a scaling factor for the Density Independent Pixel unit, where one DIP is one pixel on an approximately 160 dpi screen (for example a 240x320, 1.5"x2" screen), providing the baseline of the system's display. Thus on a 160dpi screen this density value will be 1; on a 120 dpi screen it would be .75; etc.This value does not exactly follow the real screen size (as given by xdpi and ydpi, but rather is used to scale the size of the overall UI in steps based on gross changes in the display dpi. For example, a 240x320 screen will have a density of 1 even if its width is 1.8", 1.3", etc. However, if the screen resolution is increased to 320x480 but the screen size remained 1.5"x2" then the density would be increased (probably to 1.5).
      

  3.   

    延伸阅读
    iPhone 4屏幕揭秘:高清体验与像素密度无关
    http://tech.qq.com/a/20100617/000204.htm
      

  4.   

    This value does not exactly follow the real screen size (as given by xdpi and ydpi, but rather is used to scale the size of the overall UI in steps based on gross changes in the display dpi. For example, a 240x320 screen will have a density of 1 even if its width is 1.8", 1.3", etc. However, if the screen resolution is increased to 320x480 but the screen size remained 1.5"x2" then the density would be increased (probably to 1.5).
    这段的意思可以理解为以下公式吧:
    1). 240x320 / 1.8*1.3 = 32820
    2). 320x480 / 1.5*2 = 51200 
    3). 51200 / 32800 ≈ 1.56 ≈ 1.5 倍
      

  5.   

    屏幕尺寸分为大,正常,小
    比如说 我想建立一个normal尺寸的模拟器a,它的分辨率为480*640 
    模拟器b,它的分辨率为320*480 这个不行吗?
      

  6.   

    其实就想证明button定义它的宽度是100pix的话,在不同分辨率下它会发生变化(变大或变小),
    而把它定义成dip的话(因为dip与分辨率无关,只与屏幕密度有关)所以它不发生变化。来说明dip的优点,可是觉得屏幕分辨率和屏幕密度之间的关系好像不太清楚?