0
我有以下動畫。反應原生動畫重複無窮
componentWillMount(){
this.animatedValue = new Animated.Value(300);
}
componentDidMount(){
Animated.timing(this.animatedValue , {
toValue: -100,
duration: 3000,
}).start();
}
render() {
const animatedStyle = { marginLeft: this.animatedValue, marginRight: - this.animatedValue };
return (
<View style={{flexDirection: 'row', height: 100,}}>
<Animated.View style={[ animatedStyle,{backgroundColor: 'blue', width:100}]} />
</View>
);
}
我想重複無盡的時間。任何人有任何建議?
就是這樣。謝謝 –