我为我的应用创建了一个动画资源,但是在构建它时声称所有属性都是“string types are not allowed
”。我在sdk 20编译,最少14分,目标为20分。
score_animation.xml:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:shareInterpolator="true"
android:ordering="sequentially">
<set>
<alpha
android:duration="300"
android:fromAlpha="0f"
android:toAlpha="1f" />
<scale
android:duration="300"
android:fromXScale="0.4f"
android:fromYScale="0.4f"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.0f"
android:toYScale="1.0f" />
</set>
<alpha
android:duration="300"
android:fromAlpha="1f"
android:startOffset="600"
android:toAlpha="0f" />
</set>
完整错误:
Error:(9, 32) String types not allowed (at 'fromAlpha' with value '0f').
Error:(10, 30) String types not allowed (at 'toAlpha' with value '1f').
Error:(13, 33) String types not allowed (at 'fromXScale' with value '0.4f').
Error:(14, 33) String types not allowed (at 'fromYScale' with value '0.4f').
Error:(17, 31) String types not allowed (at 'toXScale' with value '1.0f').
Error:(18, 31) String types not allowed (at 'toYScale' with value '1.0f').
Error:(23, 28) String types not allowed (at 'fromAlpha' with value '1f').
Error:(25, 26) String types not allowed (at 'toAlpha' with value '0f').
答案 0 :(得分:7)
愚蠢的我!原来它不喜欢附加的f
所以删除它们(1.0f
到1.0
等)解决了这个问题。