Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: Creating landscape layouts

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

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?

like image 330
mrd Avatar asked Mar 02 '15 17:03

mrd


People also ask

Can we create different layout files for portrait and landscape mode?

Android App Development for Beginners Step 3 – Create a layout file by right-clicking on the resources, name the file, from the 'Available qualifiers, select Orientation. Click >> option. Select Landscape from UI mode.


1 Answers

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

layout-land

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

Project Scope

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.

New directory

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:

Orientation Toggle

like image 140
MrEngineer13 Avatar answered Sep 30 '22 18:09

MrEngineer13