1. float density = dm.density; float widthDP = widthPixels / density; 2.px=dp(dpi/160) dpi=(w*w+h*h)开方/屏幕尺寸 宽dp=px(宽)/(dpi/160) 以哪个为主呢