Android/Eclipse:如何在res/drawable文件夹中添加图像?

时间:2022-03-20 06:56:32

I am completely new with Android/Eclipse. I can't figure out how to add an image in the /res/drawable folder of my Android Eclipse project.

我对Android/Eclipse完全陌生。我不知道如何在Android Eclipse项目的/res/drawable文件夹中添加图像。

12 个解决方案

#1


118  

Copy the image CTRL + C then in Eclipse select drawable folder, right click -> Paste

复制图像CTRL + C,然后在Eclipse中选择drawable文件夹,右键单击->粘贴

#2


28  

Drop in the image in /res/drawable folder. Then in Eclipse Menu, do ->Project -> Clean. This will do a clean build if set to build automatically.

在/res/drawable文件夹中删除图像。然后在Eclipse菜单中,do ->项目-> Clean。如果将其设置为自动构建,则将执行一个干净的构建。

#3


10  

Just copy the image and paste into Eclipse in the res/drawable directory. Note that the image name should be in lowercase, otherwise it will end up with an error.

只需复制映像并将其粘贴到res/drawable目录中的Eclipse中。注意,图像名称应该是小写的,否则它将以一个错误结束。

#4


6  

Right click on drawable folder_new_file- click on advanced button_ link to file in the file system_ then click on browse. finish

右键单击可绘制的folder_new_file——单击文件system_中的高级button_链接,然后单击browse。完成

#5


3  

You can just put it in on the file system. Eclipse will pick up the change on the next refresh. Click the folder and press F5 to refresh. BTW, make sure the file name does not have any capital letters... it will break android... and eclipse will let you know.

你可以把它放到文件系统中。Eclipse将在下一次刷新时接收更改。单击文件夹并按F5刷新。顺便说一句,确保文件名没有大写字母……它将打破安卓…eclipse会让你知道。

#6


2  

Thanks for the information .It helped me out as my project was somehow not visible in workspace therefore I had to insert the image from ECLIPSE IDE. Also another way to do it is: The image to be inserted should be copied ctrl+c and then right click on the drawable folder and PASTE it. The image comes in drawable folder using ECLIPSE IDE. You can use the image as an icon of the application using Manifest File-android:icon="@drawable/image_name"

谢谢您提供的信息,因为我的项目在工作空间中不可见,所以我必须插入ECLIPSE IDE中的图像。另一种方法是:插入的图像应该被复制并按ctrl+c,然后右击可绘制文件夹并粘贴。该图像是使用ECLIPSE IDE在drawable文件夹中出现的。您可以使用Manifest文件-android:icon="@drawable/image_name"作为应用程序的图标。

#7


0  

Do you want to add an image from your computer? Just right click the folder in Eclipse and click Import

你想从你的电脑上添加一个图像吗?右键单击Eclipse中的文件夹并单击Import。

#8


0  

When inserting an image into the drawable folders, another import point in addition to the "no capital letters" rule is that the image name cannot contain dashes or other special characters.

当将图像插入可绘制文件夹时,除了“无大写字母”规则之外,另一个导入点是图像名称不能包含破折号或其他特殊字符。

#9


0  

Open folder path of Android application, open src folder then Add your image in /res/drawable folder

打开Android应用程序的文件夹路径,打开src文件夹,在/res/drawable文件夹中添加图片

#10


0  

For Android Studio:

为Android工作室:

  1. Right click on res, new Image Asset

    右键单击res,新的图像资产

  2. On Asset type choose Action Bar and Tab Icons

    在资产类型中,选择操作栏和选项卡图标

  3. Choose the image path

    选择的图片路径

  4. Give your image a name in Resource name

    给您的图像以资源名命名。

  5. Next->Finish

    下一步- >完成

The image will be saved in the /res/drawable folder!

图像将被保存在/res/drawable文件夹中!

#11


-1  

Try to use jpg and png , also name your image in lowercase. Then drag and drop the image in res/drawable . then go to file and click save all . close eclipse then reopen it again . That is what worked for me .

尝试使用jpg和png,也用小写来命名你的图像。然后拖放图像在res/drawable中。然后点击文件并单击save all。关闭eclipse,然后重新打开它。这就是我的工作。

#12


-1  

You just need to copy/cut and paste the images into drawable folder using windows/mac file explorer

您只需要复制/剪切并将图像粘贴到可以使用windows/mac文件资源管理器的drawable文件夹中。

To refresh the workspace follow the steps mentioned in this question Eclipse: How do i refresh an entire workspace? F5 doesn't do it

要刷新该工作空间,请遵循Eclipse的问题:如何刷新整个工作区?F5不做

If that does not work you might wanna restart eclispe

如果不成功,您可能需要重新启动eclispe

#1


118  

Copy the image CTRL + C then in Eclipse select drawable folder, right click -> Paste

复制图像CTRL + C,然后在Eclipse中选择drawable文件夹,右键单击->粘贴

#2


28  

Drop in the image in /res/drawable folder. Then in Eclipse Menu, do ->Project -> Clean. This will do a clean build if set to build automatically.

在/res/drawable文件夹中删除图像。然后在Eclipse菜单中,do ->项目-> Clean。如果将其设置为自动构建,则将执行一个干净的构建。

#3


10  

Just copy the image and paste into Eclipse in the res/drawable directory. Note that the image name should be in lowercase, otherwise it will end up with an error.

只需复制映像并将其粘贴到res/drawable目录中的Eclipse中。注意,图像名称应该是小写的,否则它将以一个错误结束。

#4


6  

Right click on drawable folder_new_file- click on advanced button_ link to file in the file system_ then click on browse. finish

右键单击可绘制的folder_new_file——单击文件system_中的高级button_链接,然后单击browse。完成

#5


3  

You can just put it in on the file system. Eclipse will pick up the change on the next refresh. Click the folder and press F5 to refresh. BTW, make sure the file name does not have any capital letters... it will break android... and eclipse will let you know.

你可以把它放到文件系统中。Eclipse将在下一次刷新时接收更改。单击文件夹并按F5刷新。顺便说一句,确保文件名没有大写字母……它将打破安卓…eclipse会让你知道。

#6


2  

Thanks for the information .It helped me out as my project was somehow not visible in workspace therefore I had to insert the image from ECLIPSE IDE. Also another way to do it is: The image to be inserted should be copied ctrl+c and then right click on the drawable folder and PASTE it. The image comes in drawable folder using ECLIPSE IDE. You can use the image as an icon of the application using Manifest File-android:icon="@drawable/image_name"

谢谢您提供的信息,因为我的项目在工作空间中不可见,所以我必须插入ECLIPSE IDE中的图像。另一种方法是:插入的图像应该被复制并按ctrl+c,然后右击可绘制文件夹并粘贴。该图像是使用ECLIPSE IDE在drawable文件夹中出现的。您可以使用Manifest文件-android:icon="@drawable/image_name"作为应用程序的图标。

#7


0  

Do you want to add an image from your computer? Just right click the folder in Eclipse and click Import

你想从你的电脑上添加一个图像吗?右键单击Eclipse中的文件夹并单击Import。

#8


0  

When inserting an image into the drawable folders, another import point in addition to the "no capital letters" rule is that the image name cannot contain dashes or other special characters.

当将图像插入可绘制文件夹时,除了“无大写字母”规则之外,另一个导入点是图像名称不能包含破折号或其他特殊字符。

#9


0  

Open folder path of Android application, open src folder then Add your image in /res/drawable folder

打开Android应用程序的文件夹路径,打开src文件夹,在/res/drawable文件夹中添加图片

#10


0  

For Android Studio:

为Android工作室:

  1. Right click on res, new Image Asset

    右键单击res,新的图像资产

  2. On Asset type choose Action Bar and Tab Icons

    在资产类型中,选择操作栏和选项卡图标

  3. Choose the image path

    选择的图片路径

  4. Give your image a name in Resource name

    给您的图像以资源名命名。

  5. Next->Finish

    下一步- >完成

The image will be saved in the /res/drawable folder!

图像将被保存在/res/drawable文件夹中!

#11


-1  

Try to use jpg and png , also name your image in lowercase. Then drag and drop the image in res/drawable . then go to file and click save all . close eclipse then reopen it again . That is what worked for me .

尝试使用jpg和png,也用小写来命名你的图像。然后拖放图像在res/drawable中。然后点击文件并单击save all。关闭eclipse,然后重新打开它。这就是我的工作。

#12


-1  

You just need to copy/cut and paste the images into drawable folder using windows/mac file explorer

您只需要复制/剪切并将图像粘贴到可以使用windows/mac文件资源管理器的drawable文件夹中。

To refresh the workspace follow the steps mentioned in this question Eclipse: How do i refresh an entire workspace? F5 doesn't do it

要刷新该工作空间,请遵循Eclipse的问题:如何刷新整个工作区?F5不做

If that does not work you might wanna restart eclispe

如果不成功,您可能需要重新启动eclispe