0

I am creating a loading screen using animation-list but I've run into a error where I cannot get access to my res/drawable folders inside my xml file. The error I get is "No resource found that matches the given name (at 'drawable' with value '@drawable/loadingwave0.png')"

Inside the directory res/anim/ My xml code is simple:

<?xml version="1.0" encoding="utf-8"?>
<animation-list
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:oneshot="false" >  
    <item 
        android:drawable="@drawable/loadingwave0.png"
        android:duration="100" />    
</animation-list>

I've noticed that inside my item tag, Eclipse does not predict any drawable resources even though I've already copied them(not referenced) to the drawable folders(hdpi, ldpi, mdpi). My .png images can be accessed through my AndroidManifest.xml file if I use the code

<item android:icon="@drawable/loadingwave0.png"/> 

for making sure the drawable folders can be accessed. I have already cleaned and refreshed my project multiple times.

Any help would be greatly appreciated.

4

1 回答 1

1

you should use :

<?xml version="1.0" encoding="utf-8"?>
<animation-list
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:oneshot="false" >  
    <item 
        android:drawable="@drawable/loadingwave0"
        android:duration="100" />    
</animation-list>

the resource id is the file name without extension.

于 2014-09-03T02:58:49.050 回答