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:
- Right Click on res folder and create a new directory
- Give name – ‘layout-land’
Problem is- the created folder is not appearing within res folder 🙁
I am clueless, please suggest.
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.
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).
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.