此代码可在停止动画时起作用,但无法重新启动,只是在动画暂停但不再增加时就停止了?
this.animation = Animated.timing(this.state.percent, {
toValue: width / 2,
duration: this.state.timeRemaining * 1000
});
this.animation.start(st => console.log('st', st));
if (this.state.pause) {
this.state.percent.stopAnimation(val => {
this.state.percent.setValue(val);
});
clearInterval(this.state.startTimer);
}
我可以在暂停后看到st记录,但是我期待this.animation.start再次触发,但是我认为不是因为动画没有增加吗?