Android的:替代布局XML为横向模式 [英] Android: alternate layout xml for landscape mode
问题描述
我怎么能有一个布局的景观,一个用于人像?我要承担额外的宽度和节省垂直空间,当用户旋转手机在横盘。
How can I have one layout for landscape and one for portrait? I want to assume extra width and conserve vertical space when the user rotates the phone over sideways.
推荐答案
在默认情况下,在布局 / RES /布局
应用于纵向和横向。
By default, the layouts in /res/layout
are applied to both portrait and landscape.
如果您有例如:
/res/layout/main.xml
您可以添加一个新的文件夹 / RES /布局土地
,复制的main.xml
到它,使必要的调整。
you can add a new folder /res/layout-land
, copy main.xml
into it and make the needed adjustments.
另请参见<一个href="http://www.androidpeople.com/android-portrait-amp-landscape-differeent-layouts">http://www.androidpeople.com/android-portrait-amp-landscape-differeent-layouts和<一href="http://www.devx.com/wireless/Article/40792/1954">http://www.devx.com/wireless/Article/40792/1954对于一些更多的选择。
See also http://www.androidpeople.com/android-portrait-amp-landscape-differeent-layouts and http://www.devx.com/wireless/Article/40792/1954 for some more options.
这篇关于Android的:替代布局XML为横向模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!