了解三星Galaxy Tab屏幕像素密度 [英] Understanding Samsung Galaxy Tab screen density

查看:136
本文介绍了了解三星Galaxy Tab屏幕像素密度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人会说,如果Galaxy Tab的屏幕分辨率(纵向模式) 600px的键,屏幕宽度 3.55inch ,该屏幕像素密度是 600 / 3.55 = 169 DPI 。知道这一点,同时要注意与设备无关的像素(DP)的计算方法(http://developer.android.com/guide/practices/screens_support.html):

One would say that if the Galaxy Tab screen resolution (in portrait mode) is 600px and the screen width is 3.55inch, the screen density would be 600/3.55 = 169 dpi. Knowing that and keeping in mind the way the device independent pixels (dp) is computed (http://developer.android.com/guide/practices/screens_support.html):

px = dp * (dpi / 160);
600 = dp * (169 / 160);
dip = 568

因此​​绘制水平线的568dp(设备无关的像素)宽度开始在位置0必须与屏幕的宽度相匹配。但是,如果你试试这个设备上,你会发现屏幕宽度 400dp 。我将再次使用相同的公式,但为获得DPI:

So drawing a horizontal line of 568dp (device independent pixels) width starting at position 0 must exactly match the width of the screen. But if you try this on device you will find that the screen width is 400dp. I will use the same formula again but for getting dpi:

600 = 400 * (dpi / 160);
dpi = 240

因此​​具有 240dpi 3.55inch 屏幕宽度和 600pixels ,它意味着一个物理像素是由多个点,否则参数对应于 852pixel(3.55 * 240)

So having the 240dpi, 3.55inch screen width and 600pixels, does it mean that one physical pixel is composed of more ‘dots’ otherwise the parameters corresponds to the width of 852pixel (3.55*240).

我觉得DPI是指每英寸,这是每英寸的像素点。但是,这似乎并非如此......

I thought that dpi means dots per inch, which is pixels per inch. But this seems to not be true...

补充后:
这(http://developer.android.com/guide/topics/resources/more-resources.html#Dimension)说:

Added later:
This (http://developer.android.com/guide/topics/resources/more-resources.html#Dimension) says:

160dp始终是一英寸无论画面密度

160dp is always one inch regardless of the screen density

这是不正确的。只是检查从这个测量源: <一href="http://stackoverflow.com/questions/6656651/difference-between-android-dimension-pt-and-dp/7049678#7049678">Difference PT和DP

Which is not true. Just check the measurement source from this: Difference between android dimension: pt and dp

补充甚至更晚:
我问的原因是违反了规则 160dp = 1英寸导致了指定控制宽度例如,当事实320dp它将包括对Galaxy Tab的更大的部分是真的有必要和更大的,那么你会期望从600x1024px屏幕是什么...

Added even later:
The reason I am asking is that violating the rule that 160dp = 1inch leads to the fact that when specifying the control width to e.g. 320dp it will cover on Galaxy Tab much bigger portion that that really necessary and much bigger then what you would expect from 600x1024px screen...

感谢澄清 BR 斯登

推荐答案

的Galaxy Tab(7)不报告其真正的密度要理解这个问题,请阅读以下文章:

Galaxy Tab (7") doesn't report its real density. To understand this issue, read the following article:

<一个href="http://realmike.org/blog/2010/12/21/multiple-screen-sizes-with-processing-for-android/">http://realmike.org/blog/2010/12/21/multiple-screen-sizes-with-processing-for-android/

显然,这也是三星的东西时发现他们做了银河   标签。银河标签有一个7,1024×600的屏幕,170 dpi的。然而,   标签不报告其密度为MDPI而是HDPI,所以布局   看起来完全一样,在第二个屏幕。如果他们用MDPI中,   图标是0.28宽,华电国际,他们是0.42宽不是大   这笔交易,我必须承认,布局看起来的确prettier这种方式。

Apparently, that’s also what Samsung found when they made the Galaxy Tab. The Galaxy Tab has a 7″, 1024×600 screen with 170 dpi. Yet, the Tab does not report its density as "mdpi" but as "hdpi", so the layout looks exactly as in the second screenshot. If they used "mdpi", the icons would be .28″ wide, with "hdpi", they are .42″ wide—not a big deal, and I must admit, the layout does look prettier this way.

本文包含一些图像,这将使你理解这个问题。

The article contains some images that will make you understand the problem.

这篇关于了解三星Galaxy Tab屏幕像素密度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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