Android的布局文件夹:设计,布局,接口,布局土地 [英] Android layout folders: layout, layout-port, layout-land

查看:162
本文介绍了Android的布局文件夹:设计,布局,接口,布局土地的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道已经明白深受几款Android / RES /布局文件夹中所扮演的角色。

I'm not sure to have understood well the role played by the several Android /res/layout folders.

布局:通用布局

布局端口:布局小部件,必须改变为纵向

layout-port: layout for widget that must change for portrait orientation

布局陆:布局小部件必须更改横向

layout-land: layout for widget that must change for landscape orientation

例如在主页示例应用程序,在布局 - 端口布局陆文件夹中只有一个 home.xml 文件。

For example in the Home sample application, under layout-port and layout-land folders there is only one home.xml file.

有我的理解对不对?

推荐答案

如果你是在横向或纵向的Andr​​oid会在无论是-port或-land目录下的布局文件第一,如果它没有找到,然后就后退到默认的布局目录。

If you are in landscape or portrait Android looks for the layout file in either the -port or -land directory first, if it's not found then it falls back to the default layout directory.

您可以读到这里提供替代资源。有许多不仅仅是土地和港口更多的选择。

You can read about providing alternative resources here. There are many more options than just land and port.

这篇关于Android的布局文件夹:设计,布局,接口,布局土地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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