Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio - layout-land folder not appearing

Tags:

I want to support separate UIs for both portrait and landscape mode in my android studio project, for which I need to have a folder with name - 'layout-land', to create it I followed below steps:

  1. Right Click on res folder and create a new directory

Creating new layout-land dir

  1. Give name - 'layout-land'

assigning layout-land name

Problem is- the created folder is not appearing within res folder :(

layout-land not visible

I am clueless, please suggest.

like image 764
Devarshi Avatar asked Apr 05 '15 14:04

Devarshi


2 Answers

That's the slightly confusing 'android' view of Android Studio. It shows only one layout folder (also shows only one drawable folder) which really contains all folders. Switch the view to 'project' and you'll see all folders.

enter image description here

like image 176
fweigl Avatar answered Oct 13 '22 03:10

fweigl


I'm posting this just in case anyone really likes Android hirearchy of the project (note: other answers using classic hirearchy are correct as well).

All layout dirs with different qualifiers are categorized under name "layout". Just right click on the "layout" create your xml with any qualifier you need and you'll get this hirearchy (image below).

All layout dirs categorized under "layout".

Notice activity_main.xml is not a directorty but a category collecting all activity_main.xml files with different qualifiers.

This categorizing pattern appears quite often in Android hirearchy.

like image 36
Spidey Avatar answered Oct 13 '22 01:10

Spidey