首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >drawable-hdpi、drawable-ldpi、drawable-mdpi、drawable-xhdpi和drawable-xxhdpi的含义是什么

drawable-hdpi、drawable-ldpi、drawable-mdpi、drawable-xhdpi和drawable-xxhdpi的含义是什么
EN

Stack Overflow用户
提问于 2013-11-19 20:42:43
回答 5查看 31.7K关注 0票数 14

我真的很困惑在res下android drawable类型的drawable-hdpi,drawable-ldpi,drawable-mdpi,drawable-xhdpi和drawable-xxhdpi的意义是什么,以及如何决定应该使用哪一个?

EN

回答 5

Stack Overflow用户

发布于 2013-11-19 21:00:11

代码语言:javascript
复制
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

票数 12
EN

Stack Overflow用户

发布于 2013-11-19 21:01:42

这些是不同密度的图像文件夹。

hdpi图像为安卓宽屏设置或安卓手机与较高的分辨率。

ldpi早期版本的安卓系统支持较低的图像质量

支持中等图像的mdpi

最高分辨率的xhdi设备。

票数 1
EN

Stack Overflow用户

发布于 2013-11-19 20:44:53

它们用于放置不同分辨率的图像,以满足设备的不同屏幕尺寸。有关更多信息,请查看:http://developer.android.com/guide/practices/screens_support.html

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20071887

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档