Android的 - 屏幕分辨率和屏幕像素密度 [英] Android - Screen Resolution and Screen Density

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

问题描述

根据管理资源(图片)在> Android 1.6版本,我们需要保持不同的决议图像中绘制对象,华电国际,绘制对象,MDPI,绘制对象,LPI文件夹特别。

As per managing resources(images) in > Android 1.6 version, we need to keep different-resolutions image in Drawable-Hdpi, Drawable-Mdpi, Drawable-Lpi folder particularly.

和按本页面: http://developer.android.com/guide/做法/ screens_support.html

在低密度部 - 有使用三种分辨率:240 * 320的240x400,240x432的小屏幕,标准屏幕,大屏幕特别

In Low density section - there are three resolutions used: 240*320 , 240x400 , 240x432 for the Small screen, Normal Screen, Large Screen particularly.

同样的方法对中密度部分 - 有使用三种分辨率:分辨率320x480,480x800的,为480x854的小屏幕,标准屏幕,大屏幕特别

same way for Medium density section - there are three resolutions used: 320x480 , 480x800 , 480x854 for the Small screen, Normal Screen, Large Screen particularly.

和高密度相同的方式........

and same way for High density ........

但我很困惑在这里:

(1)我怎么来知道是否使用小,普通或大屏幕,我的意思是有没有办法知道?

(1) How do i come to know that whether small, Normal or Large screen is used, i mean is there any way to know ?

(2)我怎么会知道我正在使用哪种类型的密度?

(2) How do i come to know which type of density i am using ?

(3),并在绘制对象,华电国际,绘制对象,MDPI,可绘制-LDPI文件夹,我们应该保持它的分辨率的图像特别?

(3) And in Drawable-Hdpi, Drawable-Mdpi, Drawable-ldpi folder, which resolution's image we should keep particularly?

请分享你的知识。

推荐答案

有特定的Andr​​oid API调用,可以在运行时告诉你手机有什么样的密度和(小/大/正常)的屏幕尺寸。但是,作为一名开发人员,我们应该根本不需要担心个别手机。所有我们需要做的是有LDPI / MDPI /华电国际的资产和小/正常/大布局中的APK。 Android的内部处理一切。

There are specific Android API calls that can, at runtime tell you what density and (small/large/normal) screen size a handset has. However, as a developer we should not need to worry about individual handsets at all. All we need to do is to have ldpi/mdpi/hdpi assets and small/normal/large layouts in the apk. Android internally handles everything.

不要忘记让Android的如何确定要使用的资产,这里的深入理解>。

Dont forget to get an indepth understanding of how Android determines which assets to use and aliasing here.

这篇关于Android的 - 屏幕分辨率和屏幕像素密度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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