Android 版 Eclipse 中在哪里插入图像

发布于 2024-11-17 01:11:14 字数 127 浏览 2 评论 0原文

我是 Android 新手,我需要在 XML 文件中使用图像。

教程说我必须将它们放在 drawable 目录中,但我找不到它,因为我找到 drawable-hdpi 等。

I am new to Android and I need to use images in my XML file.

A tutorial says that I have to place them in drawable directory, but I can't find it as I find drawable-hdpi, etc.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

倾城泪 2024-11-24 01:11:14

Drawable 文件夹根据设备屏幕尺寸分为三部分 h- 高、M- 中、L- 低,因为在 android 中市场上可用的设备尺寸不同,并且 android 设备屏幕根据设备屏幕分为三种类型 h、m、l根据设备尺寸指定密度 android 从特定的可绘制文件夹 h、m、l 中选择图像,如果您不想在应用程序中指定密度,则添加名称为可绘制的新文件夹。

我希望它对你更有用。

drawable folder is divided into into three part according to device screen size h- high, M- Medium, L- Low because in android different size of device available in the market and android device screen divide into three type h,m,l based on density specific according to device size android pick the image from specific drawable folder h ,m ,l if you dont want to density specification in your application then add new folder with the name of drawable.

I hope it is more use full to you.

素食主义者 2024-11-24 01:11:14

您可以通过右键单击“res” -> 自行创建可绘制文件夹。 “新”-> “文件夹” 并将其命名为 drawable。如果您不需要图像特定于密度,则可以将图像放在那里。

You can create the drawable folder yourself by right-clicking "res" -> "New" -> "Folder" and naming it drawable.If you do not need your images to be density-specific, you can put your images there.

审判长 2024-11-24 01:11:14

您可以在 res 目录中创建自己的 drawable 文件夹。但请记住将图像保留在所有屏幕尺寸设备通用的文件夹中。 drwable-hdpi 表示该目录包含的图像将在设备具有更高 dpi 时加载。类似地,还有drawable-mdpidrawable-ldpi

you can create your own drawable folder in res directory. But remember keep the images in that folder which are common for all screen size devices. drwable-hdpi means this directory contained the images will be loaded when the device has higher dpi. similarly drawable-mdpi and drawable-ldpi are there.

一个人的夜不怕黑 2024-11-24 01:11:14

您找到的那些是可绘制文件夹。将图像插入所有三个文件夹中。这样,当屏幕图像的清晰度发生变化时,可以相应地进行更改。现在,在所有三个中插入相同的图像。

您可以创建自己的可绘制文件夹。但首先使用这些是很好的,然后当您在设备上运行应用程序时,您就会知道其中的区别。

Those which you found are drawable folders.. Insert the images in all three of them. So that at time of change in definition of screen images can be changed accordingly. For now, Insert same image in all three of them.

You can create your own drawable folder. But its good to use these at first then when you run your application on device you will come to know the difference.

断爱 2024-11-24 01:11:14

drawable-hdpi、drawable-mdpi 等是不同类型的可绘制对象。您可以将图像保存在这些文件夹中(初始级别的任何一个)。

但根据屏幕和分辨率的不同,它们有一些差异。 Android 设备的密度。此外,您可以检查它们之间的差异并根据需要保留图像。

有关更多详细信息,请参阅此:解释之间的区别可绘制、可绘制-ldpi、可绘制-mdpi 和可绘制-hdpi

支持多屏幕

drawable-hdpi drawable-mdpi etc are the different type of drawables . you can keep your images in these folder (any one at the initial level).

But they have some diffrence according to the resolution of the screen & density of android device. Further you can check the diffrence between them and keep the images as per need.

see this for more details: Explain the difference between drawable, drawable-ldpi, drawable-mdpi and drawable-hdpi

and Supporting Multiple Screens

做个少女永远怀春 2024-11-24 01:11:14

您可以在项目的 /res 文件夹中创建一个可绘制文件夹并将图像放在那里。

drawable-hdpi(mdpi/ldpi) 针对不同类型的屏幕使用单独的不同资源。请查看此处了解有关多屏幕处理的更多信息

you can create a drawable folder in the /res folder of your project and put your images there.

drawable-hdpi(mdpi/ldpi) are used separate different resources for different type of screen. take a look here to know more about multiple screen handling

烟酒忠诚 2024-11-24 01:11:14

我意识到这个问题相当过时了,但是......当我在 Google 上搜索将图像插入 Eclipse Android 项目的问题时,它就出现了,所以......

实际上,这些文件夹是 mipmaps 图形子系统也使用它们来提供无缝缩放。我建议使用编辑器创建适当的 mipmap,而不是只提供一种分辨率选择。

I realize that this question is rather dated, but...it came up when I Googled the issue of inserting images into an Eclipse Android project, so....

Actually, those folders are mipmaps and they are used by the graphics subsystem to provide seamless zooming, as well. I would suggest creating proper mipmaps using an editor, as opposed to providing only one resolution choice.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文