Android- How to differentiate Galaxy S-3 and Galaxy S-4 layouts?

倾然丶 夕夏残阳落幕 提交于 2019-12-10 13:24:22

问题


I am having problem differentiating layout folders for samsung galaxy s4 and samsung galaxy s3. I have tried layout-sw360dp, layout-sw360dp-xxhdpi, layout-sw360dp-xhdpi etc. All the time galaxy s4 and galaxy s3 both picks from layout-sw360dp-xhdpi.

So what should be the correct layout folder for both of these devices ?


回答1:


I am using some specific resolution values in my projects in order to differentiate these from other layouts and screens.

You can create layouts with exact minimum height and width values that can be seen from gsmarena.

Samsung S3: http://www.gsmarena.com/samsung_i9300_galaxy_s_iii-4238.php

S3 layout folder name: layout-w720-h1280

Samsung S4: http://www.gsmarena.com/samsung_i9500_galaxy_s4-5125.php

S4 layout folder name: layout-w1080-h1920

So they will be using corresponding layouts by creating layout folders like these.




回答2:


The Galaxy S4 has a Full HD screen, you could create a separate layout for this resolution by using layout-xxhdpi for the S4 and layout-xhdpi for the S3.



来源:https://stackoverflow.com/questions/20488512/android-how-to-differentiate-galaxy-s-3-and-galaxy-s-4-layouts

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