我真的很困惑在res下android drawable类型的drawable-hdpi,drawable-ldpi,drawable-mdpi,drawable-xhdpi和drawable-xxhdpi的意义是什么,以及如何决定应该使用哪一个?
发布于 2013-11-19 21:00:11
ldpi Resources for low-density (ldpi) screens (~120dpi).
mdpi Resources for medium-density (mdpi) screens (~160dpi). (This is the baseline density.)
hdpi Resources for high-density (hdpi) screens (~240dpi).
xhdpi Resources for extra high-density (xhdpi) screens (~320dpi).
nodpi Resources for all densities. These are density-independent resources. The system does not scale resources tagged with this qualifier, regardless of the current screen's density.
tvdpi Resources for screens somewhere between mdpi and hdpi; approximately 213dpi. This is not considered a "primary" density group. It is mostly intended for televisions and most apps shouldn't need it—providing mdpi and hdpi resources is sufficient for most apps and the system will scale them as appropriate. If you find it necessary to provide tvdpi resources, you should size them at a factor of 1.33*mdpi. For example, a 100px x 100px image for mdpi screens should be 133px x 133px for tvdpi.所以当你创建drawable-hdpi, drawable-ldpi, drawable-mdpi, drawable-xhdpi and drawable-xxhdpi时,手机会根据它的像素density.If适当地获取资源,没有指定任何东西,它将从drawable获取资源。有关更多详细信息,请查看here
发布于 2013-11-19 21:01:42
这些是不同密度的图像文件夹。
hdpi图像为安卓宽屏设置或安卓手机与较高的分辨率。
ldpi早期版本的安卓系统支持较低的图像质量
支持中等图像的mdpi
最高分辨率的xhdi设备。
发布于 2013-11-19 20:44:53
它们用于放置不同分辨率的图像,以满足设备的不同屏幕尺寸。有关更多信息,请查看:http://developer.android.com/guide/practices/screens_support.html
https://stackoverflow.com/questions/20071887
复制相似问题