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

编程入门 行业动态 更新时间:2024-10-28 12:24:43
本文介绍了res文件夹中的可绘制文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

项目层级中res文件夹中的三个drawable文件夹有什么区别?如果我有一张图片要放入文件夹,我应该将它放入哪个文件夹?

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?

推荐答案

我猜三个drawable文件夹"是drawable-ldpi、drawable-mdpi 和 drawable-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.

更多推荐

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

本文发布于:2023-07-17 02:36:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1128509.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件夹   文件   夹中   res

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!