Repeat animation with new animated api

后端 未结 8 1094
时光取名叫无心
时光取名叫无心 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:26

    There's now loop animation available:

    Animated.loop(
      Animated.sequence([
        Animated.timing(this.state.animatedStartValue, {
          toValue: 1,
          duration: 500,
          delay: 1000
        }),
        Animated.timing(this.state.animatedStartValue, {
          toValue: 0,
          duration: 500
        })
      ]),
      {
        iterations: 4
      }
    ).start()
    

提交回复
热议问题