简体   繁体   English

模拟器Nexus 7使用布局文件夹而不是layout-sw600dp

[英]Emulator Nexus 7 use layout folder and not layout-sw600dp

I'm trying to handle layout for different screen but I found it hard because emulators always use default layout. 我正在尝试处理不同屏幕的布局,但我发现它很难,因为模拟器总是使用默认布局。 I cannot understand why. 我不明白为什么。 I create a Nexus 7 emulator and I expected to use layout-sw600dp. 我创建了一个Nexus 7模拟器,我希望使用layout-sw600dp。 The same with Nexus 10 emulator. 与Nexus 10仿真器相同。 How came?! 怎么来的?! Thanks in advance R. 在此先感谢R.

There are 2 versions of the nexus 7 that you can choose from. 您可以选择2种版本的nexus 7。 There's the newer model and the 2012 version. 有更新型号和2012版本。 Choose the 2012 version and it should work as expected. 选择2012版本,它应该按预期工作。

在此输入图像描述

Check your layout directories once again, you might have picked wrong type of resource file. 再次检查布局目录,您可能选择了错误类型的资源文件。 Also I'd suggest to use layout-sw600dp for 7inch tablets and layout-sw720dp for larger ones. 另外我建议使用layout-sw600dp用于7英寸平板电脑,layout-sw720dp用于大型平板电脑。

When you create emulator go in Advanced settings and custom skin definition enter "no skin" 创建模拟器时,请进入高级设置和自定义皮肤定义,输入“无皮肤”

emulator skin 模拟器皮肤

There is a bug with Nexus 7 (2013) emulator. Nexus 7(2013)模拟器存在错误。 It thinks that its resolution is 1280x800, and since it is xhdpi device, final width is 400dp, so it misses sw600dp qualifier. 它认为它的分辨率是1280x800,并且因为它是xh​​dpi设备,最终宽度是400dp,所以它错过了sw600dp限定符。 You can track bug here: https://code.google.com/p/android/issues/detail?id=209440 您可以在此处跟踪错误: https//code.google.com/p/android/issues/detail?id = 209440

I will update this answer when the bug is closed. 当bug被关闭时,我会更新这个答案。

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

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