看到了一篇博客,在xml动画文件中使用ObjectAnimator节点,后来把源码下下来,载eclipse重打开,可以使用,但是在android studio中不能使用ObjectAnimator节点,怎么回事,求高手指点。
下面是源码:
< ?xml version="1.0" encoding="utf-8"? >
< set xmlns:android="http://schemas.android.com/apk/res/android"
android:ordering="together" >
< objectAnimator
android:duration="1000"
android:propertyName="scaleX"
android:valueFrom="1"
android:valueTo="0.5" >
< /objectAnimator >
< objectAnimator
android:duration="1000"
android:propertyName="scaleY"
android:valueFrom="1"
android:valueTo="0.5" >
< /objectAnimator >
< /set >
下面是报错信息:
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
Error:(1) Error parsing XML: XML or text declaration not at start of entity
D:datahongchuangkbMaintainClientcarownercomingappbuildintermediatesresmergeddebuganimanim_xml.xml
Error:(1) Error parsing XML: XML or text declaration not at start of entity
Information:Gradle tasks [:app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources]
D:datahongchuangkbMaintainClientcarownercomingappsrcmainresanimanim_xml.xml
Information:BUILD FAILED
Information:Total time: 5.064 secs
Information:3 errors
Information:0 warnings
Information:See complete output in console
回复讨论(解决方案)
放到res/animator文件夹下
可以了,多谢!