Android的工作室:可绘制文件夹:如何把图片为多DPI? [英] Android Studio: Drawable Folder: How to put Images for Multiple dpi?
问题描述
喜按照Android的文档的绘制文件夹需要有多个子目录为不同的图像干粉吸入器。然而,在Android的Studio中创建的任何子目录中的文件夹绘制导致它无法检测到的所有图像都没有。上,如果一个图像被在可提拉夹直接放置另一方面它被检测出并变为可供使用视图R.drawable.ImageName。在这种情况下,我们如何使用不同的DPI图像相同的ImageName?
Hi as per android documentation the drawable folder needs to have multiple sub-directories for images of different dpis. However in Android Studio creating any sub directory in the drawable folder causes it to fail to detect any images at all. On the other hand if an image is placed directly in the drawable folder it gets detected and becomes available for use view R.drawable.ImageName. In this case how do we use different dpi images for the same ImageName?
推荐答案
您没有创建绘制文件夹的子文件夹,而是兄弟文件夹下旁边 / RES
文件夹不同的屏幕密度和屏幕尺寸。
该 /绘制
文件夹中(不带任何尺寸)主要用于可绘制不涉及到任何尺寸的屏幕像选择
秒。
You don't create subfolders of the drawable folder but rather 'sibling' folders next to it under the /res
folder for the different screen densities or screen sizes.
The /drawable
folder (without any dimension) is mostly used for drawables that don't relate to any screen sizes like selector
s.
请参阅此截图(你仍然可以使用名称绘制 - 华电国际
,而不是纹理映射,华电国际
的):
See this screenshot (you can still use the name drawable-hdpi
instead of mipmap-hdpi
):
这篇关于Android的工作室:可绘制文件夹:如何把图片为多DPI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!