如何在Android清单上为手机和平板电脑添加屏幕支持< = 7'

时间:2014-02-25 17:27:05

标签: android screen android-manifest

我这样做:

<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="480" /><!-- new screens S4, N5, ONE... -->

<screen android:screenSize="large" android:screenDensity="hdpi" /> <!-- 7 tablets... -->
</compatible-screens>

有了这个清单,我可以确保所有设备都可以运行7英寸?

1 个答案:

答案 0 :(得分:0)

AVD中现成的设备定义列表包括两个未被清单过滤的设备:

7.0“WSVGA(平板电脑):屏幕7.0”,1024x600大mdpi
Nexus 7 :屏幕7.3“,800x1280大tvdpi

你不能在xml中使用 tvdpi ,这是解决方法:

<screen android:screenSize="large" android:screenDensity="213" />