不同的图像大小特定分辨率抽拉文件夹 [英] Different image sizes for resolution-specific Drawable folders

查看:144
本文介绍了不同的图像大小特定分辨率抽拉文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android RES 文件夹,我们与与图像不同分辨率处理几个不同的文件夹psented $ P $。在过去,我只用一个图像与一个文件夹中相同的分辨率,这一直运作良好为我的具体应用。不过,我希望能够让我未来的Andr​​oid应用基本上看对面的屏幕分辨率和设备阵列相同。任何规则或指导原则创建不同的分辨率大小时相同的图像把每个文件夹中(即,应该说走在中等分辨率的文件夹的图像进行1.5倍那些在低分辨率文件夹的大小等)去了?

In the Android res folder, we are presented with a few different folders that deal with different resolutions for images. In the past I have only used one image with the same resolution in one folder, and this has worked well for my specific applications. However, I'm hoping to make my future Android apps look essentially the same across an array of screen resolutions and devices. Any rules or guidelines to go by when creating different resolution sizes for the same image to put in each folder (i.e., should images that go in the medium resolution folder be 1.5x the size of those in a low resolution folder, etc.)?

推荐答案

什么你要找的是在为每个文件夹比例因子。这个工程通过采取 MDPI 文件夹1.0基地的规模。

What you're looking for is the scale-factor for each folder. This works by taking the mdpi folder as the "base" scale of 1.0.

标度系数为每个文件夹如下:

Scale-factors for each folder are as follows:


  • LDPI> 0.75

  • MDPI> 1.0

  • 华电国际> 1.5

  • xhdpi> 2.0

  • xxhdpi> 3.0

  • xxxhdpi> 4.0

因此​​,例如,采取48 * 48像素的图像作为你的基地MDPI的形象,你最终与32,48,72,96,144和192px图像。

So, for example, taking a 48*48px image as your base mdpi image, you'd end up with 32, 48, 72, 96, 144 and 192px images.

富勒更多的细节,包括源每个值的,从中检查出鞋大鼠的出色答卷我来源多这一个。

Fore more detail, including the source for each of these values, check out shoe-rat's excellent answer from which I sourced much of this one.

这篇关于不同的图像大小特定分辨率抽拉文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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