Android- How to differentiate Galaxy S-3 and Galax

2019-06-18 19:58发布

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 ?

enter image description here

2条回答
我命由我不由天
2楼-- · 2019-06-18 20:40

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.

查看更多
够拽才男人
3楼-- · 2019-06-18 20:45

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.

登录 后发表回答