本文介绍了如何使应用程序在所有屏幕上“更大"显示?比hdpi的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Android初学者,为了使我的应用在所有屏幕上看起来都不错,我在努力工作,我为hdpi,xhdpi,xxhdpi设置了不同的布局以解决此问题,因为一些搜索栏和文本视图在较小的屏幕上消失了. >

是否有一种方法可以在Android清单中指定只有具有hdpi屏幕或更高版本的人才能从playstore下载我的应用?

我在下面的stackoverflow上进行了查看,并阅读了android开发人员指南,但是找不到在hdpi及以上版本上运行的解决方案.

https://developer.android.com/guide/topics/manifest/compatible-screens-element.html https://developer.android.com/guide/practices/screens_support.html

解决方案

您只需要根据需要在Manifest中添加类似内容:

<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" />
        <screen android:screenSize="small" android:screenDensity="xxhdpi" />
        <screen android:screenSize="small" android:screenDensity="xxxhdpi" />
        <!-- 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="xxhdpi" />
        <screen android:screenSize="normal" android:screenDensity="xxxhdpi" />
    </compatible-screens>
    <application ... >
        ...
    <application>
</manifest>

请阅读以下详细信息: https://developer.android.com/guide/topics/manifest/compatible-screens-element.html

I am beginner Android developer and I am in a struggle making my app look good on all screens, i made different layouts for hdpi,xhdpi,xxhdpi to solve that, since some seekbars and textviews were disappearing on smaller screens..

Is there a way to specify in android manifest that only people with hdpi screens and above can download my app from playstore?

I looked on below stackoverflow, and have read android developer guides, but I can't find solution to make it work on hdpi and above.

https://developer.android.com/guide/topics/manifest/compatible-screens-element.htmlhttps://developer.android.com/guide/practices/screens_support.html

解决方案

You just need to add something like this in your Manifest depending on what you want:

<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" />
        <screen android:screenSize="small" android:screenDensity="xxhdpi" />
        <screen android:screenSize="small" android:screenDensity="xxxhdpi" />
        <!-- 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="xxhdpi" />
        <screen android:screenSize="normal" android:screenDensity="xxxhdpi" />
    </compatible-screens>
    <application ... >
        ...
    <application>
</manifest>

Please read this for more info: https://developer.android.com/guide/topics/manifest/compatible-screens-element.html

这篇关于如何使应用程序在所有屏幕上“更大"显示?比hdpi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-03 14:26