2014-10-28 59 views
5

爲什麼xxhdpixxxhdpi用於清單<screen>元件的screenDensity參數不允許的值?爲什麼「xxhdpi」不允許在清單screenDensity參數的值[限制片劑]

我試圖限制我的應用程序在使用官方Android Developers website - Declaring an App is Only for Handsets推薦的解決方案的平板電腦上的使用。我想兼容的標記只小和正常的屏幕尺寸(與任何密度):

<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> 

然而,增加

<screen 
     android:screenDensity="xxhdpi" 
     android:screenSize="normal" /> 

是不允許的。不與Error: String types not allowed (at 'screenDensity' with value 'xxhdpi').編譯'xxxhdpi'同樣發生。

我發現爲相應的密度插入整數(例如screenDensity="480")的作品,但我想知道爲什麼它不允許所有現有密度桶的字符串表達式?

回答

相關問題