How to Add/Create Landscape Layout in Android Studio

In android, every application is designed in almost both the orientations i.e Portrait and Landscape. By default Android Studio gives you the option to design your application in Portrait mode but for Landscape we need to make some extra settings or more specifically, we need to add/create a Landscape Layout folder under res folder. As per Android developer website guide lines the name of this folder should be “layout-land”.


How to Add / Create Landscape Layout in Android Studio

Lets see how to create layout-land inside your project:

Step 1: Open your Android Studio and if your project is opened in “Android” perspective then change it to “Project” Perspective(Option is available on the Left side of your android studio)

Project perspective Android Studio

Step 2: Open App folder inside your project folder

Step 3:  Then open src > main >res. Here you have all the folder which help in creating UI for your app.

app src res folder in Android Studio

Step 4: Right click on res folder click New>Directory. Android studio will open a dialog box.

Create New Directory in res Android Studio

Step 5: Inside Dialog box you have to give a directory name or you can say name of our new folder. So it would be “layout-land”. Click Ok.

layout-land directory in res folder android studio

Step 6: Now you have “layout-land” folder in your project. Right click on it New>XML>Layout XML file. This file will be create inside layout folder(portrait)

layout xml file in layout land folder android studio

Step 7: Cut layout xml file

Cut layout xml android studio

Step 8: Paste it under your “layout-land” folder and click ok. Now open your xml file. You will get the Landscape mode.

paste layout in layout-land android studio

DOWNLOAD THIS FREE eBook!

This free eBook will help you master the learning of Android App Development in Android Studio!

One thought on “How to Add/Create Landscape Layout in Android Studio”

  1. hey, by this method I have to code for landscape variation again. What’s the use buddy ?I am not getting the relative landscape variation, I have to code it again !
    Help me out !