使用布局大型,布局正常和布局,XLARGE文件夹屏幕支持多台设备 [英] screen support multiple devices using layout-large,layout-normal and layout-xlarge folders

查看:157
本文介绍了使用布局大型,布局正常和布局,XLARGE文件夹屏幕支持多台设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建的布局大 布局正常布局XLARGE RES 文件夹和我复制所有的XML文件的布局文件夹

I created layout-large, layout-normal and layout-xlarge in the res folder and I copied all the xml files to those layout folders

首先,我要问什么是之间的区别的布局(在默认)和  布局正常文件夹?

First, I want to ask what is the difference between layout (the default) and layout-normal folder?

我知道,如果我跑在大屏幕尺寸的应用程序将采取XML文件从布局XLARGE 。 所以,我提出的布局XLARGE的所有的元素看起来像我想用的FrameLayout中的 TAP2 10.1 但是当我在注2或S3移动它看起来不同,因为在屏幕大小是不一样的

I know if I run the application on big screen size the app will take the xml files from layout-xlarge. So I made all the elements in layout-xlarge look as I want using FrameLayout in tap2 10.1, but when I run it in note2 or s3 mobile it looks different because the screen size is not same.

那么,如何可以使TAP2 10.1(1280×800),并注2或S3移动(1280×720)尺寸的应用程序运行?

So how can I make the the application run in tap2 10.1 (1,280 x 800) and note2 or s3 mobile (1,280 x 720) size?

推荐答案

这里有官方如何支持所有的屏幕尺寸描述。和所描述的布局文件夹是:

Here there is the official description of how support all the screen size. And as described the layout folders are:

res/layout/my_layout.xml             // layout for normal screen size ("default")
res/layout-small/my_layout.xml       // layout for small screen size
res/layout-large/my_layout.xml       // layout for large screen size
res/layout-xlarge/my_layout.xml

所以布局布局正常文件夹是相同的,但新的Andr​​oid API中没有没有更多的布局正常的文件夹中,但只有布局文件夹。另外你要知道,如果没有在女巫的应用程序正在运行的屏幕尺寸的具体布局,默认情况下,应用程序需要的默认的布局。

So layout and layout-normal folder are the same, but in the new Android API there isn't no more the layout-normal folder, but only layout folder. Also you have to know if there isn't the specific layout of the screen size in witch the app is running, by default the app takes the "default" layout.

修改

您可以有不同的屏幕分辨率在同一个文件夹中,你可以从这个影像学:

You can have different screen resolutions in the same folder, as you can learn from this images:

如果你想为特定分辨率更具体的布局,你必须检测在运行时准确的屏幕尺寸。

If you want a more specific layout for specific resolution you have to detect at run time the exact screen size.

这篇关于使用布局大型,布局正常和布局,XLARGE文件夹屏幕支持多台设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆