简体   繁体   中英

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

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').

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 :)

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 :)

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. It should solve your problem. If not try to create next folder named drawable and put image inside.

Are the drawables visible from the eclipse IDE in the drawable folder?

  • No? Right click at the project explorer and refresh.

Also try clean the project so it is recreates the Generated files like R.java

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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