简体   繁体   English

在 Android Studio 中使用 sw-600 和横向限定符创建布局变化

[英]Creating layout variation with both the sw-600 and landscape qualifiers in Android Studio

I have already created a Landscape variation and a Tablet variation of my layout.我已经创建了我的布局的横向变体和平板电脑变体。 However, I also want to create a variation that is just for tablets in landscape mode.但是,我还想创建一个仅适用于横向模式的平板电脑的变体。 I had thought this would be possible by clicking the orientation button in the design toolbar, then selecting 'Create Other..." to select multiple qualifiers. However Android Studio will not allow me to create a variant with both the sw-600 and land qualifiers. It gives me an error message saying the layout resource already exists. But looking in my project directory, I don't see it.我原以为这可以通过单击设计工具栏中的方向按钮,然后选择“创建其他...”到 select 多个限定符来实现。但是 Android Studio 不允许我使用 sw-600 和土地创建变体限定符。它给了我一条错误消息,说布局资源已经存在。但是在我的项目目录中,我看不到它。

I'm still pretty new to android so I apologize if the answer to this should be obvious.我对 android 还是很陌生,所以如果这个问题的答案应该很明显,我很抱歉。 Thanks for any help you can give!谢谢你提供的所有帮助!

Screenshot showing my Project directory, new resource dialog, and error message显示我的项目目录、新资源对话框和错误消息的屏幕截图

What you are looking for is layout-sw600dp-land .您正在寻找的是layout-sw600dp-land See the Add orientation qualifiers Android developer documentation for more information.有关详细信息,请参阅添加方向限定符Android 开发人员文档。

To do this, manually create a new folder under your res directory named layout-sw600dp-land from the command line and place your new layout xml file there.为此,请从命令行手动在 res 目录下创建一个名为layout-sw600dp-land的新文件夹,并将新的布局 xml 文件放在那里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM