简体   繁体   English

支持不同的屏幕和三星s7 dpi

[英]Supporting different screens and Samsung s7 dpi

I've checked android's website about supporting multiple screens but I'm a little confused by dpi. 我检查了android网站是否支持多种屏幕,但对dpi感到有些困惑。 I've a Samsung s7 (not the edge) and I test my app on it. 我有一个三星s7(不是边缘),我在上面测试了我的应用程序。 I'm not sure if it's in the mdpi or hdpi group. 我不确定它是否在mdpi或hdpi组中。 Thank you 谢谢

you can use float density = getResources().getDisplayMetrics().density; 您可以使用float density = getResources().getDisplayMetrics().density; in your app. 在您的应用中。 and can check if the current device is mdpi, hdpi, xhdpi etc. Here is link to official docs. 并可以检查当前设备是否为mdpi,hdpi,xhdpi等。这是官方文档的链接

Samsung s7 is of 1440x2560 resolution, which is a xxxhdpi device. Samsung s7的分辨率为1440x2560,是xxxhdpi设备。 Normally, 一般,

hdpi: 480X800
xhdpi: 720X1280
xxhdpi: 1080X1920
xxxhdpi: 1440X2560

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM