gpt4 book ai didi

android - Play 商店的应用程序屏幕密度支持

转载 作者:行者123 更新时间:2023-11-30 01:30:35 25 4
gpt4 key购买 nike

我想在 Play 商店中为所有密度的小型和普通手机部署我的应用程序。android:screenDensity <screen> 的属性元素没有 xxhdpixxxhdpi密度作为预定义值。我应该使用这些值 480560对于相应的缺失密度?

或者我可以用这个吗?

<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="false"
android:xlargeScreens="false"/>

这是否涵盖了所选屏幕尺寸的所有密度?

最佳答案

<supports-screens>标签,设置 android:largeScreens 的值和 android:xlargeScreens设置为 false 不会使您的应用程序无法用于这些屏幕尺寸。它只会为您的应用在这些屏幕尺寸上启用屏幕兼容模式。

来自 Android 开发者 doc :

android:largeScreens

Indicates whether the application supports larger screen form-factors. A large screen is defined as a screen that is significantly larger than a "normal" handset screen, and thus might require some special care on the application's part to make good use of it, though it may rely on resizing by the system to fill the screen. The default value for this actually varies between some versions, so it's better if you explicitly declare this attribute at all times. Beware that setting it "false" will generally enable screen compatibility mode.

android:xlargeScreens

Indicates whether the application supports extra large screen form-factors. An xlarge screen is defined as a screen that is significantly larger than a "large" screen, such as a tablet (or something larger) and may require special care on the application's part to make good use of it, though it may rely on resizing by the system to fill the screen. The default value for this actually varies between some versions, so it's better if you explicitly declare this attribute at all times. Beware that setting it "false" will generally enable screen compatibility mode.

如果您想让您的应用仅适用于手机,请将以下内容添加到您的 list 中:

<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" />
<screen android:screenSize="small" android:screenDensity="480" />
<!-- 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="small" android:screenDensity="480" />
</compatible-screens>

带有 android:screenDensity="480" 的条目是为了支持 xxhdpi 桶。

看看this article Android 开发者文档,其中解释了如何让您的应用仅供手机使用。

关于android - Play 商店的应用程序屏幕密度支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35793753/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com