簡體   English   中英

如何設置最小屏幕尺寸?

[英]How to set minimum screen size?

我創建了新的應用程序,不適用於手機。 我的應用程序基於7“平板電腦設備。當我嘗試將我的應用程序放入Play商店時顯示,我支持2000個Android設備,但不是所有都是平板電腦。實際上,我不想谷歌所有它的設備和設置過濾器,你知道為什么!

我如何在我的應用程序中以編程方式聲明最小屏幕大小,就像我可以設置最小的sdk級別。

更新:

我在AndroidManifest.xml中設置了<compatible-screens><supports-screens> ,如下所示:

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


<compatible-screens>
    <screen android:screenSize="xlarge" android:screenDensity="xhdpi"/>
    <screen android:screenSize="xlarge" android:screenDensity="ldpi"/>
    <screen android:screenSize="xlarge" android:screenDensity="hdpi"/>
    <screen android:screenSize="xlarge" android:screenDensity="mdpi"/>


</compatible-screens>

現在我的應用只適用於7英寸以上的平板電腦。

您需要使用<supports-screens>作為DJHacktorReborn建議,但不僅僅是android:requiresSmallestWidthDp ,因為Play商店不會使用它進行過濾。

相反,使用:

<manifest ... >
    <supports-screens android:smallScreens="false"
                      android:normalScreens="false"
                      android:largeScreens="true"
                      android:xlargeScreens="true"
                      android:requiresSmallestWidthDp="600" />
    ...
    <application ... >
        ...
    </application>
</manifest>

有關更多信息,請參閱文檔

您可以在清單中定義這樣的有關mutliScreenSupport的更多詳細信息

 <manifest ... >
        <supports-screens android:requiresSmallestWidthDp="600" />
        ...
    </manifest>

對於市場過濾器,您需要使用<compatible-screens> 更多詳細信息

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM