Android Studio:创建横向布局 [英] Android Studio: Creating landscape layouts

查看:93
本文介绍了Android Studio:创建横向布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到最近我使用 Eclipse,在 Eclipse 中我只是创建了一个文件夹/res/layout-landscape 并将替代的横向布局放在里面.

Until recently I used Eclipse, and in Eclipse I simply created a folder /res/layout-landscape and put alternate landscape layouts inside.

但是,在Android Studio 1.1.0 中,我好像不能那样做.如何为备用横向布局创建文件夹?

However, it seem in Android Studio 1.1.0, I can't do it that way. How do I create the folder for alternate landscape layouts?

推荐答案

您实际上可以在 Android Studio 中使用 layout-land 并且它会显示在您的 res 中目录如下:

You can actually use layout-land in Android Studio as well it will show up in your res directory like so:

如果它没有出现,请确保将您的项目范围设置为 Project 而不是 Android.

If it doesn't show up make sure to have your project scope set to Project and not Android.

如果您仍然没有看到,您可以通过右键单击 res 目录并选择 New -> 来创建一个.Android资源目录并填写下面的提示.

If you still don't see one you can create one by right clicking on the res directory and selecting New -> Android resource directory and filling out the prompt below.

此外,创建后,您可以通过布局预览上方工具栏上的方向按钮在布局预览中轻松地从纵向切换到横向.如下图:

Also, once it's been created, you can easily switch from portrait to landscape in the layout preview via the orientation button found on the toolbar above the layout preview. It is pictured below:

这篇关于Android Studio:创建横向布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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