Devarshi
Devarshi

Reputation: 16758

Android Studio - layout-land folder not appearing

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.

Upvotes: 23

Views: 26503

Answers (2)

Spidey
Spidey

Reputation: 974

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.

Upvotes: 6

fweigl
fweigl

Reputation: 22038

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

Upvotes: 51

Related Questions