如何指定不同的布局为纵向和横向? [英] How do I specify different layouts for portrait and landscape orientations?

查看:161
本文介绍了如何指定不同的布局为纵向和横向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过提到能够指定两个不同的布局的XML文件的一个活动,一个竖拍,一个用于景观。我一直没有找到如何做,虽然任何信息。我如何为每个活动而XML文件是纵向布局,这是景观布局指定?

I've seen references to being able to specify two separate layout xml files for an activity, one for Portrait and one for Landscape. I've not been to find any information on how to do that though. How do I specify for each activity which xml file is it's portrait layout and which is the Landscape layout?

时,也可​​以指定不同的布局不同的屏幕大小?如果是这样,这是怎么做的?

Is it also possible to specify different layouts for different screen sizes? If so, how is this done?

推荐答案

您只需要把它放在不同的名称取决于方向和分辨率单独的文件夹,该设备会自动选择合适的一个用于它的屏幕设置

You just have to put it under separate folders with different names depending on orientation and resolution, the device will automatically select the right one for its screen settings

在这里更多信息:

<一个href="http://developer.android.com/guide/practices/screens_support.html">http://developer.android.com/guide/practices/screens_support.html

在资源目录预选赛的​​屏幕大小和密度

under "Resource directory qualifiers for screen size and density"

这篇关于如何指定不同的布局为纵向和横向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆