gpt4 book ai didi

android - 摇动动画无法正常工作

转载 作者:行者123 更新时间:2023-11-29 15:48:50 25 4
gpt4 key购买 nike

这是xml代码。

<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXDelta="0" android:toXDelta="10" android:duration="1000"
android:interpolator="@anim/cycle_7" />

这是 cycle_7.xml 文件...

<?xml version="1.0" encoding="utf-8"?>
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android" android:cycles="7" />

这就是我使用它的方式。

final Animation animAlpha2 = AnimationUtils.loadAnimation(this, R.anim.anim);
v.startAnimtion(anumAlpha2);

最佳答案

android:interpolator="@anim/cycle_7" 行替换为:

android:repeatCount="7"
android:repeatMode="reverse"

这应该可以解决问题。 repeatCount 设置动画将执行的循环次数和 repeatMode 可以假定为 two values , repeat and restart.

关于android - 摇动动画无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31517080/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com