针对Nexus 7的错误dpi值&QUOT ;.错误的平台,还是我们做错了什么? [英] Wrong dpi value for Nexus 7". Bug in the platform, or are we doing something wrong?

查看:210
本文介绍了针对Nexus 7的错误dpi值&QUOT ;.错误的平台,还是我们做错了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这code:

activity.getWindowManager().getDefaultDisplay().getMetrics(dm);

在新的Nexus

是报告景观xdpi = 195.38461 7.我卷尺说,屏幕是1/16害羞6宽,并在1280像素,该工程以215.57894。

is reporting landscape xdpi = 195.38461 on the new Nexus 7. My tape measure says the screen is 1/16" shy of 6" wide, and at 1280 pixels, that works out to 215.57894.

是的,我们的Andr​​oid.xml说:

And yes, our Android.xml says:

<uses-sdk android:minSdkVersion="16"/>

这只是一个错误,还是我们做错了什么?

Is this just a bug, or are we doing something wrong?

推荐答案

从的从戴安娜Hackborn这种反应的:

对不起,你就不能使用它们。在平台上没有什么利用的
  他们。它们需要由制造商设置(没有办法为
  该平台知道它们是什么),并从今天开始他们只是不
  一贯正确设置跨设备,并且由于没有在
  平台对他们的依赖很容易让设备将其设置
  不正确。

Sorry you just can't use them. Nothing in the platform makes use of them. They need to be set by the manufacturer (there is no way for the platform to know what they are), and as of today they are just not consistently set correctly across devices, and because nothing in the platform relies on them it is easy for devices to have them set incorrectly.

基本上,你可以不依赖于返回什么,在所有。

Basically, you can't rely on what that returns, at all.

这篇关于针对Nexus 7的错误dpi值&QUOT ;.错误的平台,还是我们做错了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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