【问题标题】:How to target xxxhdpi devices in Android manifest file?如何在 Android 清单文件中定位 xxxhdpi 设备?
【发布时间】:2016-03-23 07:56:01
【问题描述】:

根据 Google 文档 (http://developer.android.com/guide/topics/manifest/compatible-screens-element.html#compatible-screens),我正在使用 <compatibile screen> 标签来定位我的应用程序的特定屏幕(我正在尝试仅定位手机)。这是我的清单:

<compatible-screens>
    <!-- all small size screens -->
    <screen android:screenSize="small" android:screenDensity="ldpi" />
    <screen android:screenSize="small" android:screenDensity="mdpi" />
    <screen android:screenSize="small" android:screenDensity="hdpi" />
    <screen android:screenSize="small" android:screenDensity="xhdpi" />
    <!-- all normal size screens -->
    <screen android:screenSize="normal" android:screenDensity="ldpi" />
    <screen android:screenSize="normal" android:screenDensity="mdpi" />
    <screen android:screenSize="normal" android:screenDensity="hdpi" />
    <screen android:screenSize="normal" android:screenDensity="xhdpi" />

    <screen android:screenSize="normal" android:screenDensity="420" />
    <screen android:screenSize="normal" android:screenDensity="480" />
    <screen android:screenSize="normal" android:screenDensity="560" />

</compatible-screens>

但是,如果这样做,某些设备在 Google Play 商店中被列为不兼容,例如三星 Galaxy S6、nexus 5x 和 nexus 6P。似乎不包括所有具有非常高 dpi 的设备 (xxxdpi)。如何包含这些手机?

【问题讨论】:

  • 你让它工作了吗?我无法让 S6+、5X 或 nexus 6P 出现在 Play 商店中。
  • Nexus 6P, Galaxy S6,.. 是 xxhdpi

标签: android android-manifest hdpi


【解决方案1】:

使用可以这样定义在manifest文件中

<supports-screens android:resizeable=["true"| "false"]
                  android:smallScreens=["true" | "false"]
                  android:normalScreens=["true" | "false"]
                  android:largeScreens=["true" | "false"]
                  android:xlargeScreens=["true" | "false"]
                  android:anyDensity=["true" | "false"]
                  android:requiresSmallestWidthDp="integer"
                  android:compatibleWidthLimitDp="integer"
                  android:largestWidthLimitDp="integer"/>

更多详情请点击此链接 http://developer.android.com/guide/topics/manifest/supports-screens-element.html

【讨论】:

  • 我一直在使用它,但 Play 商店仍然挡住了 S6+ edge、Nexus 5X 和 Nexus 6P。我没有包含requiresSmallestWidthDpcompatibleWidthLimitDplargestWidthLimitDp 的值,因为它们似乎不需要。我所有的其他参数都设置为true
  • 为了支持 S6+、nexus 5x 和其他类似设备,我只在清单中添加了这些信息。请记住,这样您将只支持智能手机而不支持平板电脑:
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-11-06
  • 2022-09-25
  • 1970-01-01
  • 1970-01-01
  • 2011-01-06
相关资源
最近更新 更多