Android的:替代布局XML为横向模式横向、布局、模式、Android

2023-09-12 00:08:05 作者:归隐

我怎么能有一个布局的景观,一个用于人像?我要承担额外的宽度和节省垂直空间,当用户旋转手机在横盘。

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.

另请参见http://www.androidpeople.com/android-portrait-amp-landscape-differeent-layouts和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.

 
精彩推荐
图片推荐