Repeat animation with new animated api

后端 未结 8 873
时光取名叫无心
时光取名叫无心 2021-01-31 14:40

React-native introduce new Animated API, I want to make a loop animation such as a bubble scale up then scale down and repeat that progress.

However I can n

8条回答
  •  天涯浪人
    2021-01-31 15:14

    Try something like this:

    componentDidMount() {
        this.bootAnimation();
      }
    
      bootAnimation() {
        this.animation = Animated.loop(
          Animated.timing(this.state.progress, {
            toValue: 1,
            duration: 5000
          })
        ).start();
      }

提交回复
热议问题