且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

res文件夹中的可绘制文件夹?

更新时间:2022-11-28 19:12:03

我猜三个drawable文件夹"是drawable-ldpidrawable-mdpidrawable-hdpi.在这种情况下,如果您坚持使用所有这些文件夹,则需要在每个文件夹中放置一张图像,其大小与指示的屏幕密度相匹配.这在在线文档以及本博文.你可以找到一组示例项目,展示了基于屏幕密度的不同可绘制资源的使用 这里.

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 开发,您可以删除所有这三个目录并创建一个 drawable 目录,将您的图像放在那里.不过,最终,对于高质量的应用程序,您将需要在具有不同屏幕密度的不同设备/模拟器上测试您的图像,并且可能为每种密度使用不同的图像以改善您的应用程序的外观.

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.