如何让自己开发的android支持多种不同的手机屏幕(supporting Multiple Screens)
2012-03-05 18:58
585 查看
转换式为:px=dp*(dpi/160)
其中px为最终显示的像素数目;dp为density-independent pixel,即A virtual pixel unit that you should use when defining UI layout, to express layout dimensionsor position in a density-independent way. The density-independent pixel is
equivalent to one physical pixel on a 160 dpi screen, which isthe baseline density assumed by the system for a "medium" density screen. At runtime, the systemtransparently handles any scaling of the dp units, as necessary, based on the actual density of thescreen
in use. The conversion of dp units to screen pixels is simple:
证明:设两个不同屏幕上的一段等长距离a,原始图对应width值为dp,目标屏幕密度为dpi,最终在屏幕显示的像素数目为x,则有a=dp/160=x/dpi。变形即有所示转换式。
原文链接
其中px为最终显示的像素数目;dp为density-independent pixel,即A virtual pixel unit that you should use when defining UI layout, to express layout dimensionsor position in a density-independent way. The density-independent pixel is
equivalent to one physical pixel on a 160 dpi screen, which isthe baseline density assumed by the system for a "medium" density screen. At runtime, the systemtransparently handles any scaling of the dp units, as necessary, based on the actual density of thescreen
in use. The conversion of dp units to screen pixels is simple:
px = dp * (dpi / 160).;dpi为目标手机的实际像素密度(Screen density)
证明:设两个不同屏幕上的一段等长距离a,原始图对应width值为dp,目标屏幕密度为dpi,最终在屏幕显示的像素数目为x,则有a=dp/160=x/dpi。变形即有所示转换式。
原文链接
相关文章推荐
- Supporting Multiple Screens(支持Android各种屏幕尺寸)
- Android 支持不同的屏幕 Supporting Different Screens
- Android开发兼容不同分辨率设备的资源命名方法(Supporting Multiple Screens )
- android 布局如何支持多种不同屏幕尺寸
- Android training(2)-Designing for Multiple Screens(为支持多种屏幕而设计)(B)
- android 布局如何支持多种不同屏幕尺寸
- android 布局如何支持多种不同屏幕尺寸
- Android training(3)-Designing for Multiple Screens(为支持多种屏幕而设计)(C)
- android 布局如何支持多种不同屏幕尺寸
- android 布局如何支持多种不同屏幕尺寸
- android 布局如何支持多种不同屏幕尺寸
- 如何使Android应用支持多种屏幕分辨率
- android开发如何更好的解决适配不同屏幕大小移动设备的问题
- Android官方开发文档Training系列课程中文版:多样屏幕之支持不同的屏幕尺寸
- 关于android手机开发中支持不同分辨率的总结
- Android如何自适应多种屏幕手机
- 【官方】Android提供的支持不同屏幕大小的全部方法(Supporting Different Screen Sizes)
- Android开发第3-2课:支持不同的屏幕
- Android如何自适应多种屏幕手机?
- Android 中,应用程序需要的图片资源如何针对不同屏幕大小手机设计?