Mar*_*Bro 5 android android-screen-support
为什么 在Manifest中允许xxhdpi 和 xxxhdpi 不允许 元素screenDensity 参数的 值<screen> ?
我正在尝试使用官方Android开发者网站推荐的解决方案限制我在平板电脑上使用我的应用程序- 声明应用程序仅适用于手机.我想只标记小尺寸和普通屏幕尺寸(任何密度)兼容:
<compatible-screens>
<!-- all small size screens -->
<screen
android:screenDensity="ldpi"
android:screenSize="small" />
<screen
android:screenDensity="mdpi"
android:screenSize="small" />
<screen
android:screenDensity="hdpi"
android:screenSize="small" />
<screen
android:screenDensity="xhdpi"
android:screenSize="small" />
<!-- all normal size screens -->
<screen
android:screenDensity="ldpi"
android:screenSize="normal" />
<screen
android:screenDensity="mdpi"
android:screenSize="normal" />
<screen
android:screenDensity="hdpi"
android:screenSize="normal" />
<screen
android:screenDensity="xhdpi"
android:screenSize="normal" />
</compatible-screens>
Run Code Online (Sandbox Code Playgroud)
但是,添加
<screen
android:screenDensity="xxhdpi"
android:screenSize="normal" />
Run Code Online (Sandbox Code Playgroud)
不被允许.不编译用Error: String types not allowed (at 'screenDensity' with value 'xxhdpi').'xxxhdpi'也是如此.
我发现插入相应密度的整数(例如screenDensity="480")可以工作,但我想知道为什么它不允许所有现有密度桶的字符串表达式?
屏幕密度的 Android 开发人员指南似乎与您的经历一致。它还提到,对于 xxhdpi 及更高版本,您必须手动输入 dpi 值。至于为什么,确实没说……
http://developer.android.com/guide/topics/manifest/completed-screens-element.html
注意:此属性当前不接受 xxhdpi 作为有效值,但您可以指定 480 作为值,这是 xhdpi 屏幕的近似阈值。
| 归档时间: |
|
| 查看次数: |
2643 次 |
| 最近记录: |