在res文件夹可绘制文件夹? [英] Drawable folders in res folder?

查看:192
本文介绍了在res文件夹可绘制文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在项目层次的资源文件夹三个绘制文件夹之间的区别是什么?如果我有一个形象放到一个文件夹,我把它放在哪个文件夹?

What is the difference between the three drawable folders in the res folder in the project hierarchy? If I have an image to put into a folder, which folder do I put it in?

推荐答案

我要采取猜测,三可绘制文件夹是绘制-LDPI 绘制-MDPI 绘制 - 华电国际。在这种情况下,如果你坚持与所有这些文件夹,你需要把每一个图像,大小相匹配的指示屏幕像素密度。 // WWW:这是在href="http://developer.android.com/guide/practices/screens_support.html">在线文档的blog帖子。你可以找到一个集显示使用不同的绘制资源样本项目基于屏幕像素密度这里

I am going to take a guess that "the three drawable folders" are drawable-ldpi, drawable-mdpi, and drawable-hdpi. In that case, if you stick with all of those folders, you need to put one image in each, sized to match the indicated screen density. This is discussed in the online documentation as well as this blog post. You can find a set of sample projects showing use of different drawable resources based on screen density here.

如果你是刚刚开始在Android开发,你可以摆脱所有这三个目录,并创建一个绘制目录,把你的图片在那里。但是,最终的高质量的应用程序,你会想在不同的设备/仿真器具有不同的屏幕密度测试你的图片,并可能有不同的图像的每个密度来提高你的应用程序的外观。

If you are just starting out in Android development, you can get rid of all three of those directories and create a single drawable directory, putting your image in there. Eventually, though, for a quality application, you will want to test your images on different devices/emulators with different screen densities, and possibly have different images for each density to improve the look of your app.

这篇关于在res文件夹可绘制文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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