1
\$\begingroup\$

I want to make a separate landscape layout for each size of my original layout

I have activity_main.xml. I have adapted it to be able to fit multiple screen sizes:

enter image description here

Now, I want to create a landscape layout for each different screen size. The android docs and many (Many!) stack overflow pages suggest to do something like this to create a new landscape layout:

enter image description here

But after doing this, I create a landscape layout for all of the activity_main.xml's I need a separate landscape for the large activity_main, the small activity_main, the xlarge activity_main, and the normal activity_main. By doing the method described everywhere, I end up with this:

enter image description here

And because this covers all of the activity_main.xml's, I don't get the option to 'Create Landscape Variationon my other versions of myactivity_main`.

So, how do I get separate landscape layouts for each already made variation of activity_main?

Thanks so much,

Ruchir

\$\endgroup\$
1
\$\begingroup\$

Instead of choosing 'Create Landscape Variation', try 'Create Other...' instead. Then you can make a new layout for whatever set of constraints you want. If you want a layout for xlarge screen and landscape. Then just choose size and orientation as your qualifiers and set them correctly to xlarge and landscape. This should create a new folder with a layout for you.

For more detailed explanation on how to create these folders in Android Studio, try looking at this answer. https://gamedev.stackexchange.com/a/112232/75055

Lastly, ask yourself this. Do you really need a separate layout for each possible screen size? Most apps would be fine with 1-2, one for phone sized screens and maybe one for xlarge/tablet sized screens.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.