简体   繁体   English

Android可绘制

[英]Android drawable

I've a little problem with drawable repertory : I added an image in all drawable repertory (hdpi,ldpi,mdpi,etc ..) but in my file xml, when I wrote 我对drawable格式有一个小问题:我在所有drawable格式(hdpi,ldpi,mdpi等)中添加了一个图像,但是在我写的文件xml中

android:backgroud="@drawable/fond_ecran"

I've this error message : Error: No resource found that matches the given name (at 'background' with value '@drawable/fond_ecran'). 我收到此错误消息: Error: No resource found that matches the given name (at 'background' with value '@drawable/fond_ecran').

I don't understand why because the image fond_ecran.png is in all drawable repertory so if someone have an explication to give me, it's will be cool :) 我不明白为什么,因为fond_ecran.png图片在所有可绘制的库中,所以如果有人给我一个说明,那就太酷了:)

I don't understand why because the image fond_ecran.png is in all drawable repertory so if someone have an explication to give me, it's will be cool :) 我不明白为什么,因为fond_ecran.png图片在所有可绘制的库中,所以如果有人给我一个说明,那就太酷了:)

At first check if you don't have errors in XML and Java files(because if you have, R.java is not correctly generated) and clean and build your project again. 首先,请检查XMLJava文件中是否没有错误(因为存在错误,因此无法正确生成R.java ),然后再次清理并构建项目。 It should solve your problem. 它应该可以解决您的问题。 If not try to create next folder named drawable and put image inside. 如果没有尝试创建下一个名为drawable文件夹,然后将图像放入其中。

Are the drawables visible from the eclipse IDE in the drawable folder? 从eclipse IDE中的drawable文件夹中是否可以看到drawable?

  • No? 没有? Right click at the project explorer and refresh. 右键单击项目浏览器并刷新。

Also try clean the project so it is recreates the Generated files like R.java 也尝试清理项目,以便它重新创建R.java类的生成文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM