2017-01-20 4 views
0

アニメーションの途中でアニメーションを開始するAnimated.timing()を使用して、反応ネイティブのアニメーションを1つ作成しました。 CSSのthisのような遅延に負の値を適用する方法はありますか?私のサンプルコードは、下記のようなものです:負の遅延を持つAnimated.timing()

Animated.timing(this.state.animatedVal, { 
    toValue: 100, 
    duration: 500, 
    easing: Easing.inOut(Easing.ease), 
    delay: 200, 
}).start() 

答えて

0

私の知る限りでは、負の遅延は、しかし、あなたは同じ効果を得るためにアニメーションを開始する前に、あなたのアニメーション値にsetValueを使用することができます...ものではありません。アニメーションの急激なジャンプを引き起こす可能性があるため、実際にアニメーション化された値のユースケースに依存しますが、途中でアニメーションを開始したいので、これはたとえば次のように動作します。

this.state.animatedVal.setValue(50); 
Animated.timing(this.state.animatedVal, { 
    toValue: 100, 
    duration: 250, // the portion of the time of the full animation 
    easing: Easing.inOut(Easing.ease), 
}).start() 
関連する問題