【问题标题】:Android background image size for XXHDPIXXHDPI 的 Android 背景图像大小
【发布时间】:2013-11-08 18:47:52
【问题描述】:

我需要为我的应用程序设置背景图片,唯一的问题是我不知道 XXHDPI 设备的图片大小。

我在这里阅读了 MDPI、HDPI 和 XHDPI 设备,但没有阅读 XXHDPI: Android splash screen image sizes to fit all devices

那么,drawable-xxhdpi 文件夹的背景必须是多大?

【问题讨论】:

    标签: android background png drawable


    【解决方案1】:

    你需要this

    还有这个: MDPI:x1, HDPI:x1.5, XHDPI: x2, XXHDPI: x3

    【讨论】:

      【解决方案2】:

      MDPI 是您的基准。表示基本尺寸,约为 160dpi。每隔一个密度限定符都是根据基线计算的

      HDPI 为 1.5*MDPI

      XHDPI 是 2*MPDI

      XXHDPI 是 3*MDPI

      XXXHDPI 是 4*MDPI

      或者,查看此表以获得更好的描述

      | Density Qualifier | Factor                 | DPI  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
      |-------------------|------------------------|------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
      | ldpi              | MDPI / 1.33            | ~120 | Resources for low-density (ldpi) screens (~120dpi).                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
      | mdpi              | MDPI * 1               | ~160 | Resources for medium-density (mdpi) screens (~160dpi). (This is the baseline density.)                                                                                                                                                                                                                                                                                                                                                                                                                       |
      | hdpi              | MDPI * 1.5             | ~240 | Resources for high-density (hdpi) screens (~240dpi).                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
      | xhdpi             | MDPI * 2               | ~320 | Resources for extra-high-density (xhdpi) screens (~320dpi).                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
      | xxhdpi            | MDPI * 3               | ~480 | Resources for extra-extra-high-density (xxhdpi) screens (~480dpi).                                                                                                                                                                                                                                                                                                                                                                                                                                           |
      | xxxhdpi           | MDPI * 4               | ~640 | Resources for extra-extra-extra-high-density (xxxhdpi) uses (~640dpi).                                                                                                                                                                                                                                                                                                                                                                                                                                       |
      | nodpi             | See description        | n/a  | 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             | Recommended: MDPI*1.33 | ~213 | 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. |
      

      查看此图片了解更多信息

      来源:https://developer.android.com/training/multiscreen/screendensities

      【讨论】:

      • 我知道这适用于图标,但它也适用于背景吗?
      • 我很抱歉。甚至没有看到你回复我......这取决于很多不同的事情。但对于较小的应用程序,我会跳过 hdpi、mdpi 和 ldpi 并将其全部放入 /drawable 将高分辨率图像放在那里,密度较低的手机会缩小它们。
      • developer.android.com/guide/practices/screens_support.html 在这个日期仍然没有谈论 xxhdpi ...我不知道你是怎么想到 3*mdpi 但谢谢!
      • 不知道你发链接的时候是不是没说,现在说的是mdpi (medium) ~160dpixxhdpi (extra-extra-high) ~480dpi。这就是我得到 MDPI * 3 的地方
      猜你喜欢
      • 2023-04-03
      • 2011-04-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-21
      • 2019-08-18
      • 2014-09-27
      • 1970-01-01
      相关资源
      最近更新 更多