ANDROID Studio: Picking up seemingly wrong layout [duplicate]

浪尽此生 提交于 2019-12-13 07:11:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!