我想重置动画并随着道具的变化重播,但它一开始只能工作一次。我使用了react-native-animatable npm 库,但找不到重置动画的解决方案。
这是我的动画代码。
import * as Animatable from 'react-native-animatable';
function ResetAnimation (changeAnimation) {
const zoomAnimation = {
0: {
scale: 1
},
0.5: {
scale: 2
},
1: {
scale: 1
}
};
return (
<View>
<Animatable.View animation = {zoomAnimation}>
<View>
// At first it works well but next no animation.
.......
</View>
</Animatable.View>
</View>
);
}
帮我。