android - 顺序动画 XML 中的错误

标签 android xml animation

我正在其中使用动画。我在使用顺序动画时遇到编译时错误。

错误是:

Multiple annotations found at this line:
    - error: No resource identifier found for attribute 'pivotX' in package 
     'android '
    - error: No resource identifier found for attribute 'fromXScale' in package 
     'android '
    - error: No resource identifier found for attribute 'toXScale' in package 
     'android '
    - error: No resource identifier found for attribute 'toYScale' in package 
     'android '
    - error: No resource identifier found for attribute 'duration' in package 
     'android '
    - error: No resource identifier found for attribute 'fromYScale' in package 
     'android '
    - error: No resource identifier found for attribute 'pivotY' in package 
     'android '

我的 xml 代码是:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android "
    android:fillAfter="true"
    android:interpolator="@android:anim/linear_interpolator" >

    <scale
        xmlns:android="http://schemas.android.com/apk/res/android "
        android:duration="1000"
        android:fromXScale="1"
        android:fromYScale="1"
        android:pivotX="50%"
        android:pivotY="50%"
        android:toXScale="3"
        android:toYScale="3" >
    </scale>


    <scale
        xmlns:android="http://schemas.android.com/apk/res/android "
        android:duration="1000"
        android:fromXScale="1.0"
        android:fromYScale="1.0"
        android:pivotX="50%"
        android:pivotY="50%"
        android:toXScale="0.5"
        android:toYScale="0.5" >
    </scale>

</set>

谁能告诉我为什么是因为?

最佳答案

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" **<----- remove space**
    android:fillAfter="true"
    android:interpolator="@android:anim/linear_interpolator" >

    <scale
        xmlns:android="http://schemas.android.com/apk/res/android "
        android:duration="1000"
        android:fromXScale="1"
        android:fromYScale="1"
        android:pivotX="50%"
        android:pivotY="50%"
        android:toXScale="3"
        android:toYScale="3" >
    </scale>


    <scale
        xmlns:android="http://schemas.android.com/apk/res/android "
        android:duration="1000"
        android:fromXScale="1.0"
        android:fromYScale="1.0"
        android:pivotX="50%"
        android:pivotY="50%"
        android:toXScale="0.5"
        android:toYScale="0.5" >
    </scale>

关于android - 顺序动画 XML 中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23147588/

相关文章:

c# - 使用 C# 反序列化 XML

Http Post 请求消息正文中的 C# Xml

xml - 什么时候以及为什么 XML 比 CSV 更可取?

silverlight - 如何在 Windows Phone 7 中创建连续动画?

javascript - Jquery 动画创建的元素

安卓模拟器 : Calendar application will not synchronize with google calendar

Android:像在 Twitter 应用程序中一样平滑地下拉 View

android - 无法在 Android 中为 ListView ItemLongClick 启动 ActionMode 回调

java - Android Eclipse 字符串 Txt + Edittext + 字符串 Txt = 崩溃

java - 如何设置循环动画