Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
238 views
in Technique[技术] by (71.8m points)

Android Studio: Creating landscape layouts

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 Studio 1.1.0, I can't do it that way. How do I create the folder for alternate landscape layouts?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...