如何设置方向在两个不同的模式,有两种布局? [英] How to set orientation in two different mode , in two layout?
问题描述
我的布局,被称为的main.xml
和我的设置方向为纵向我的的AndroidManifest.xml
。我设计了这个布局蜂窝太大,并放置在布局XLARGE-MDPI
文件夹,但我想用的main.xml
在布局XLARGE-MDPI
仅在横向方向。
I have layout that is called Main.XML
and I set the orientation to portrait in my AndroidManifest.xml
. I designed this layout for Honeycomb too and placed it in the layout-xlarge-mdpi
folder, but I want to use the Main.XML
in layout-xlarge-mdpi
only in landscape orientation.
现在,怎样才能做到这一点?
Now, how can do this?
感谢
推荐答案
您可以将您的的main.xml
在布局XLARGE陆
,那么它将只在横向
请参阅支持多画面(使用配置预选赛)
You can place your main.xml
in layout-xlarge-land
, then it will be used only in landscape orientation
Refer Supporting Multiple Screens (Using configuration qualifiers)
Android支持多种配置 预选赛,使您能够控制 系统如何选择你的 基于此替代资源 当前设备的特性 屏幕。一个配置预选赛是 字符串,可以附加到一个 在你的Android资源目录 项目和指定 配置的量,资源 内部设计。
Android supports several configuration qualifiers that allow you to control how the system selects your alternative resources based on the characteristics of the current device screen. A configuration qualifier is a string that you can append to a resource directory in your Android project and specifies the configuration for which the resources inside are designed.
编辑:
如果你提供了一个的main.xml
在布局
文件夹和另一个的main.xml
在布局XLARGE陆
,然后
If you provide an main.xml
in layout
folder and another main.xml
in layout-xlarge-land
, then
-
为
超大横向
这将采取main.xml中的布局XLARGE陆
为其他,那就是在横向或纵向
这将采取 main.xml中的布局
请参照<一href="http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources"相对=nofollow>提供了替代资源了解更多详细信息
Refer Providing Alternative Resources for more details
这篇关于如何设置方向在两个不同的模式,有两种布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!