Android Studio: Creating landscape layouts

后端 未结 5 1626
囚心锁ツ
囚心锁ツ 2020-11-29 01:47

Until recently I used Eclipse, and in Eclipse I simply created a folder /res/layout-landscape and put alternate landscape layouts inside.

However, it seem in Android

5条回答
  •  眼角桃花
    2020-11-29 02:21

    You can actually use layout-land in Android Studio as well it will show up in your res directory like so:

    layout-land

    If it doesn't show up make sure to have your project scope set to Project and not Android.

    Project Scope

    If you still don't see one you can create one by right clicking on the res directory and selecting New -> Android resource directory and filling out the prompt below.

    New directory

    Also, once it's been created, you can easily switch from portrait to landscape in the layout preview via the orientation button found on the toolbar above the layout preview. It is pictured below:

    Orientation Toggle

提交回复
热议问题