Android的布局文件夹:设计,布局,接口,布局土地布局、文件夹、接口、土地

2023-09-13 23:39:57 作者:不再见i

我不知道已经明白深受几款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.