问题描述
我不知道已经明白深受几款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.
有我的理解对不对?
推荐答案
如果你是在横向或纵向的Android会在无论是-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.
您可以读到这里提供替代资源。有许多不仅仅是土地和港口更多的选择。
这篇关于Android的布局文件夹:设计,布局,接口,布局土地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!