我的 RN 项目中有以下 lottie 动画:
<Animation
ref={animation => {
this.animation = animation;
}}
style={{
width: 40,
height: 40
}}
loop={true}
source={favorite}
progress={0}
/>
我将动画包裹在 a<touchableOpacity/>
中是否可以在 lottie 中做这样的事情:
onPress={() => {
this.animation.play().then(
// do something
)
}
我想等待动画播放完毕,然后再继续做其他事情。这可能吗?