Android: alternate layout xml for landscape mode

后端 未结 6 505
故里飘歌
故里飘歌 2020-11-22 08:54

How can I have one layout for landscape and one for portrait? I want to assume extra width and conserve vertical space when the user rotates the phone over sideways.

6条回答
  •  伪装坚强ぢ
    2020-11-22 09:17

    Fastest way for Android Studio 3.x.x and Android Studio 4.x.x

    1.Go to the design tab of the activity layout

    2.At the top you should press on the orientation for preview button, there is a option to create a landscape layout (check image), a new folder will be created as your xml layout file for that particular orientation

提交回复
热议问题