屏幕尺寸和QUOT;与&QUOT差异;和"屏幕像素密度"在Android的? [英] Difference between "screen size" and "screen density" in Android?
问题描述
我有几个问题:
-
什么是的的屏幕尺寸的?
什么是的屏幕像素密度的?
什么是的区别之间的的屏幕尺寸和屏幕像素密度的?
我如何支持不同密度和不同尺寸的屏幕在Android中?
How I can support different densities and different screen sizes in Android?
我已经看过href="http://developer.android.com/training/multiscreen/screendensities.html" rel="nofollow">官方文档的屏幕尺寸和屏幕像素密度之间的差异的。
I have already read the official documentation, but I was unable to understand the difference between screen size and screen density.
推荐答案
- 屏幕像素密度意味着多少像素的显示屏的恒定范围内出现,每英寸点数= DPI
- 屏幕尺寸指物理可用空间量显示的界面,屏幕的对角线,寸
- 屏幕分辨率是指在显示屏,独立的规模像素= SP 可用像素数
- 密度无关像素 =虚拟像素,是独立的屏幕密度, DP
- Screen density means how many pixels appear within a constant area of the display, dots per inch = dpi
- Screen size means amount of physical space available for displaying an interface, screen's diagonal, inch
- Screen resolution means number of pixels available in the display, scale-independent pixel = sp
- density-independent pixel = virtual pixel that is independent of the screen density, dp
- (1)谷歌文档说:应用程序不应该普遍担心这个密度;依托XHIGH图形被放大到它应该能够满足几乎所有的情况。
- 启动图标为Android市场:512×512像素
- (1)为了模拟这种配置中,创建一个使用WVGA800或WVGA854皮肤Android虚拟设备时指定的160自定义的密度。
- (2)为了模拟这种配置中,创建一个使用WVGA800或WVGA854皮肤Android虚拟设备时指定的120自定义的密度。
- (3)皮肤可用的Android 3.0平台。
-
使用WRAP_CONTENT,在XML布局文件中指定的尺寸时match_parent,或
DP
单位。除了定义文字大小:SP
(比例取决于用户设置) Use wrap_content, match_parent, or
dp
units when specifying dimensions in an XML layout file. Except for defining text sizes:sp
(scaling depends on user setting)
密度类:
图标大小:
屏幕尺寸类:
屏幕配置:
最佳实践:
不要在您的应用程序code使用硬codeD像素值。
Do not use hard coded pixel values in your application code.
不要使用AbsoluteLayout,使用相对布局。
Do not use AbsoluteLayout,use Relative Layout.
供应替代位图可绘制不同的屏幕密度。
Supply alternative bitmap drawables for different screen densities.
为xxhdpi一个发射器的图标,但没有其他的图标。
Provide a launcher icon for xxhdpi, but no other icons.
这篇关于屏幕尺寸和QUOT;与&QUOT差异;和"屏幕像素密度"在Android的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!