Galaxy S6屏幕尺寸-android [英] Galaxy S6 screen dimensions - android

查看:106
本文介绍了Galaxy S6屏幕尺寸-android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用下面的代码来获取Galaxy S6屏幕的宽度(以像素为单位)

I use the below code to get the width of a Galaxy S6 screen in pixels

DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
Log.i("INFO", "width pixels "+metrics.widthPixels);

在一个应用程序上,这将返回1440,这与Samsung的设置是正确的. 在另一个应用程序上,相同的代码返回1080 ??

On one app this returns 1440 which is correct as per Samsung. On another app the same code returns 1080 ??

密度也从4更改为3,xdpi 580也更改为435

density also changes from 4 to 3 as well as xdpi 580 to 435

为什么我会得到两个不同的结果? 这两个应用程序都针对相同的SDK:23和最小SDK:10

Any ideas why I'm getting two different results? Both apps target the same SDK: 23 and min SDK: 10

推荐答案

不同的分辨率是由Samsung设备上的gameservice引起的.您可以通过安装设备上的>三星游戏调谐器" ,并将您的应用设置为完整模式. AFAIK无法通过编程方式将应用设置为完整模式.

The different resolutions are caused by the gameserviceon Samsung devices. You can check this by installing the Samsung Game Tuner on the device and setting your application to full mode. AFAIK there's no programatic way to set the app to full mode.

这篇关于Galaxy S6屏幕尺寸-android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆