Mikhail Mikhail - 1 year ago 126
Android Question

5.2'' and 5.0'' screen support on android devices

I have been struggling with this problem about a week and can not figure out how to make it work. I have some views on a screen. And one

resource file. Also I have
nexus 5.2 1080*1920 420dpi
nexus 5.0 1080*1920 xxhdpi
. The layout appears differently on both screens. How to make it display the same on each device?
What resource file should I add (if it is any)?

How to add for example
values\dimens.xml(1080*1920 420dpi)



Answer Source

I think your layout is simply built as poorly scaling. Unless you have some very specific use case, you need to make sure your layout fills the area it is provided with regardless.

As for the resource folder, if you want to make sure the same layout file is used on large screens, it is enough to put it in the folder layout-sw360dp. If you have xxhdpi devices with the resolution 1080x1920, Android will select the same file for both since the smallest side will be exactly 1080 / 3 = 360 density-independent pixels.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download