Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio layout editor always landscape?

My app is going to be just landscape. But each time I need to set the xml layout editor to landscape mode when I start editing a layout. How can I have my xml layout editor always stay in landscape mode?

like image 482
sajjad Avatar asked Oct 27 '25 13:10

sajjad


2 Answers

you must build layouts on Landscape variation. image

so you can choose this on top bar of android studio xml design.

like image 63
alireza daryani Avatar answered Oct 30 '25 03:10

alireza daryani


You can do it exactly like @alireza daryani suggested.

  1. Open your layout.xml
  2. Choose Create landscape variation

Create landscape variation

  1. If you don't need the porttrait variation delete it

"Create landscape variation" will create a layout-land folder in your project so Android Studio will know that these layouts shall be previewed in landscape mode. Into this folder will be an exact copy your origin layout. In my case I just wanted landscape layout for my app, so I deleted the origins. Works perfect.

like image 25
Marcel Hofgesang Avatar answered Oct 30 '25 03:10

Marcel Hofgesang