如何设置android布局以支持所有屏幕尺寸? [英] How to set android layout to support all screen sizes?
问题描述
我正在 android 版本 2.2 上开发一个程序.我已经阅读了许多关于支持多种屏幕尺寸的文档,但仍然感到困惑.我设计了一个布局文件,支持大屏幕和普通屏幕,当我在小屏幕上尝试时,它没有调整布局以适应屏幕.我也在清单中使用了此代码.
I am developing a program on android version2.2. I have read many documentation on supporting multiple screen sizes but still confused. I designed a layout file, that supports for large and normal screens, when am trying it with small screen it is not adjusting the layout to fit the screen. I used this code in the manifest also.
<supports-screens
android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true"
/>
小屏幕的图片在这里.如何设置兼容小屏幕的屏幕?我通过使用文件夹layout-small"找到的某处,但如果我使用它,项目大小会增加,我不想要那样,所以有人可以建议我这样做的最佳方法吗?
The image for the small screen is here. How can I set the screen that compatible with small screen? Somewhere I found by using the folder "layout-small" but if I use this, the project size is increasing, I don't want that, so can any one suggest me the best way to do this?
推荐答案
请浏览以下链接.这些可能对您有所帮助:
Please go through the following links. These might help you:
AFAIK,支持所有屏幕的唯一方法是进行文件夹分叉.每个 XML 文件最多可达几千字节.因此,尺寸不应该是一个太大的问题.
AFAIK, the only way to support all screens is by doing that folder bifurcation. Every XML file goes up to a few kilo bytes. So, size shouldn't be too much of an issue as such.
这篇关于如何设置android布局以支持所有屏幕尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!