[英]how to make my application support for all devices resolution
I have develop an app which runs very well in my emulator and in my Samsung device. 我开发了一个在模拟器和三星设备上都能很好运行的应用程序。 But when I test it in the Motorola emulator, which I have downloaded in my android SDK, it doesn't work.
但是,当我在我的android SDK中下载的Motorola模拟器中对其进行测试时,它不起作用。 Can anyone help me out to figure this problem of supporting multiple devices?
谁能帮我解决支持多个设备的问题?
You can add following code in your AndroidManifest.xml to support different screens. 您可以在AndroidManifest.xml中添加以下代码以支持不同的屏幕。
<supports-screens android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true">
Check this for more details http://developer.android.com/guide/topics/manifest/supports-screens-element.html Hope this will help you. 请检查此以获取更多详细信息, http://developer.android.com/guide/topics/manifest/supports-screens-element.html希望对您有所帮助。
It is not really clear what is your problem, but often if the resolution changes the layout problems can be many. 目前还不清楚您的问题是什么,但是如果分辨率改变,布局问题通常会很多。 One of them is the unit used in the xml of the layout:
其中之一是布局xml中使用的单位:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13px"
android:paddingLeft="10px" />
in this case for example textSize is in pixel, which can be small or bigger depending from the DPI of te screen. 在这种情况下,例如textSize以像素为单位,取决于屏幕的DPI,它可以更大或更小。 You can change this specify other units of measurements like points:
您可以更改此指定其他度量单位,例如点:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13pt"
android:paddingLeft="10pt" />
put more details in your question. 在您的问题中提供更多细节。
我很大程度上取决于您的问题所在,但是如果问题是您的应用无法安装,请尝试将其添加到AndroidManifest中
<supports-screens android:anyDensity="true" />
SDK 1.5 did not support the drawable sub-folders ( /hdpi
, /mdpi
& /sdpi
) for the different resolutions. 对于不同的分辨率,SDK 1.5不支持可绘制的子文件夹(
/hdpi
, /mdpi
和/sdpi
)。 If you need your App to work on all SDKs, you should put all your drawables in the /drawable
folder (not its subfolders). 如果需要您的应用程序在所有SDK上都可以运行,则应将所有可绘制对象放在
/drawable
文件夹(而不是其子文件夹)中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.