问题
APOLOGIES folks, I posted this earlier in a wrong head; so ignore duplication
I am new to android studio. so please excuse if the query is trivial. My problem is with understanding the layouts.
My layout and the corresponding values folder is as shown below. My problem is that a correct layout is not being picked up. For example, for Nexus 4 (4.7inch, 768x1280, xhdpi), in the landscape mode, the layout is being picked up from the 'layout' folder. As per my understanding (which might be totally wrong ) it should have been picked from layout-sw720dp-xhdpi. Any suggestions please?
回答1:
sw stands for smallest width. So if the a device has a width of 320dp in portrait mode and 720dp in landscape mode then you end the device's smallest width is 320dp.
Try use layout-w720dp-xhdpi instead of layout-sw720dp-xhdpi and see if it works.
Edit: According to Wikipedia "The Nexus 7 screen now has a 1920×1200 pixel resolution (960dp × 600dp)". So its smallest width is 600dp which is why your layout isn't being used.
来源:https://stackoverflow.com/questions/36834204/android-studio-picking-up-seemingly-wrong-layout