Android Studio报Element XXXX must be declared的解决方法

今天从Eclipse上移植了一个我以前写的Demo,发现在as中会出现:
Element animation-list must be declared
在编写帧动画的xml文件时,将动画的xml文件放到了 res/anim目录中,我的xml如下:

<?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/vol_0" android:duration="300" />
    <item android:drawable="@drawable/vol_1" android:duration="300" />
    <item android:drawable="@drawable/vol_2" android:duration="300" />
</animation-list>

这就出现了:Element animation-list must be declared
后面搜索了一下后就知道了原因,是因为在as中检测资源文件更严格,所以会出现这个错误,不过我们只需要移植到drawable文件下就好了。
把这些资源文件移动到drawable资源文件夹下即得到解决。

转自:http://www.lovecoder.cn/838.html

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容