这是我的XML文件,然后是anim文件夹。当我运行该应用程序时,将显示解析错误。
shake.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
< translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXDelta="0%"
android:interpolator="@anim/cycle_7"
android:toXDelta="5%" />
</set>
cycle_7.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
< cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:cycles="7" />
</set>
IT人员始终欢迎您在这里找到所需的完整代码。
<translate xmlns:android="http://schemas.android.com/apk/res/android" android:fromXDelta="0%" android:toXDelta="5%" android:duration="1000" android:interpolator="@anim/cycle_7" />
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android" android:cycles="7" />
private void showError() {
Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);
mEditText.startAnimation(shake);
}
<
,translate
如果您已复制代码。一探究竟。<set>
不需要,因为我已经使用上述代码运行了演示程序,但工作正常。谢谢。愿这对您有帮助。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句