问题
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. The same with Nexus 10 emulator. How came?! Thanks in advance R.
回答1:
There are 2 versions of the nexus 7 that you can choose from. There's the newer model and the 2012 version. Choose the 2012 version and it should work as expected.
回答2:
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.
回答3:
When you create emulator go in Advanced settings and custom skin definition enter "no skin"
emulator skin
回答4:
There is a bug with Nexus 7 (2013) emulator. It thinks that its resolution is 1280x800, and since it is xhdpi device, final width is 400dp, so it misses sw600dp qualifier. You can track bug here: https://code.google.com/p/android/issues/detail?id=209440
I will update this answer when the bug is closed.
来源:https://stackoverflow.com/questions/31991776/emulator-nexus-7-use-layout-folder-and-not-layout-sw600dp