问题描述
学习Android的,现在我一些图片付诸绘制迪尔斯(华电国际/ LDPI / MDPI / xhdpi)。我读了很多,但我又不懂。其中大小应该是图像每个目录?
Study android, now I've some images to put into drawable dirs (hdpi/ldpi/mdpi/xhdpi). I read a lot but again I don't understand. Which size should be an image for every directories?
推荐答案
希望这将有助于...
Hope this will help...
MDPI是参考密度 - 即,1像素的MDPI显示器上等于1浸。比资产比例为:
mdpi is the reference density -- that is, 1 px on an mdpi display is equal to 1 dip. The ratio for asset scaling is:
ldpi | mdpi | hdpi | xhdpi | xxhdpi | xxxhdpi
0.75 | 1 | 1.5 | 2 | 3 | 4
尽管你并不真的需要担心tvdpi,除非你正在开发专门针对谷歌电视还是原来的Nexus 7 - 但即使是谷歌建议只使用华电国际的资产。你也许并不需要担心xxhdpi是(虽然它从未伤害,并且至少启动器图标应该xxhdpi提供),并xxxhdpi只是在源$ C $ C恒定的,现在(没有设备使用,我也不希望任何要一段时间,如果有的话),因此它是安全的忽视,以及。
Although you don't really need to worry about tvdpi unless you're developing specifically for Google TV or the original Nexus 7 -- but even Google recommends simply using hdpi assets. You probably don't need to worry about xxhdpi either (although it never hurts, and at least the launcher icon should be provided at xxhdpi), and xxxhdpi is just a constant in the source code right now (no devices use it, nor do I expect any to for a while, if ever), so it's safe to ignore as well.
如果你正在做一个48dip形象,并计划支持高达xhdpi解析这句话的意思是,你应该从一96PX图像(144px,如果你想为xxhdpi原生资产),并为密度以下图片:
What this means is if you're doing a 48dip image and plan to support up to xhdpi resolution, you should start with a 96px image (144px if you want native assets for xxhdpi) and make the following images for the densities:
ldpi | mdpi | hdpi | xhdpi | xxhdpi | xxxhdpi
36 x 36 | 48 x 48 | 72 x 72 | 96 x 96 | 144 x 144 | 192 x 192
和这些应该显示在大致相同的尺寸上的任何设备,只要您放置这些密度特定文件夹(如绘制-xhdpi,绘制,华电国际等。)
And these should display at roughly the same size on any device, provided you've placed these in density-specific folders (e.g. drawable-xhdpi, drawable-hdpi, etc.)
有关参考,像素密度为它们是:
For reference, the pixel densities for these are:
ldpi | mdpi | hdpi | xhdpi | xxhdpi | xxxhdpi
120 | 160 | 240 | 320 | 480 | 640
这篇关于图像尺寸(绘制,华电国际/ LDPI / MDPI / xhdpi)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!